This is a preview cover like fb personal cover.
bower install ng-preview-cover
or
npm install ng-preview-cover
npm install
- angularjs
- IE10
- chrome
- firefox
Set some attributes
<div ng-preview-cover
drag-text="drag photo"
update-button-text="update cover photo"
image="image"
on-load="onLoad(base64)"
on-cancel="onCancel()"
cover-loading="coverLoading"
on-enter="onEnter()"></div>
Listen some events
app.controller('previewCoverCtrl',function( $scope ){
angular.extend( $scope,{
onLoad:function( base64 ){
//base64 == $scope.image
//do something...
},
onCancel:function(){
//do something...
},
onEnter:function(){
//do something...
}
});
});
Cover image
A updating button text
A dragging message
open or close a loading block
Set disabled if you want to hide the camera button.
<div ng-preview-cover mode="disabled" />
Set a common action by event
app.run(function( previewCover ){
previewCover.on('load', function( evt ){
//do something...
});
});
gulp server
gulp