allenJynRoyston / ngCroppie

An Angular module for the awesome Croppie.js!
MIT License
40 stars 36 forks source link

ngCroppie - Angular Croppie Tool

Build Status Bower version NPM version Dependency Status NPM Montly Downloads MIT License

Angular Croppie Tool is an image cropping and rotating module for AngularJS based on Croppie.js
Pure Javascript implementation; Also responsive!

Dependencies

Installation

# Using bower:
$ bower install ngCroppie

# Using npm:
$ npm install ng-croppie

Basic usage

Demo

Example

JS

function ExampleCtrl() {
  var vm = this;

  vm.inputImage = null;
  vm.outputImage = null;

  vm.onUpdate = function(data) {
    //console.log(data);
  };
}

angular
  .module('exampleModule', ['ngCroppie'])
  .controller('ExampleCtrl', [ExampleCtrl]);

HTML

<ng-croppie   src="https://github.com/allenJynRoyston/ngCroppie/raw/master/inputImage"
              ng-model='outputImage'
              update='onUpdate'
              boundry="{w: 400, h: 400}"
              viewport="{w: 300, h: 300}"
              orientation="true"
              rotation="90"
              type="circle">
</ng-croppie>

<!-- Preview -->
<img ng-src="https://github.com/allenJynRoyston/ngCroppie/raw/master/{{outputImage}}" />

Parameters

Version

1.2.2

Updates

Contributors

License

MIT © ngCroppie