AngularJS directive for croping avatar from image
Usage
- Add avatar-editor.min.js and avatar-editor.min.css to you main file (index.html)
In your web page:
<link rel="stylesheet" href="bower_components/ngImgCrop/compile/minified/ng-img-crop.css"/>
<link rel="stylesheet" href="bower_components/dist/avatar-editor.min.css"/>
<script src="bower_components/angularjs/angular.js"></script>
<script src="bower_components/ngImgCrop/compile/unminified/ng-img-crop.js"></script>
<script src="bower_components/dist/avatar-editor.min.js"></script>- Set
avatarEditoras a dependency in your module
var myapp = angular.module('myapp', ['avatarEditor'])- Add avatar-editor directive to the wanted element, example:
<div data-avatar-editor data-mode-upload="1" data-mode-edit="1"> .... </div>data-mode-camera="1" - to enable capture from webcamera
data-result-size="400" - result image size (default 200)