avatar-editor

AngularJS directive for croping avatar from image


Keywords
angular, avatar editor, avatar crop
Install
bower install avatar-editor

Documentation

AngularJS directive for croping avatar from image

Usage

  1. 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>
  1. Set avatarEditor as a dependency in your module
var myapp = angular.module('myapp', ['avatarEditor'])
  1. 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)