GitXplorerGitXplorer
t

angular-cropper

public
24 stars
12 forks
4 issues

Commits

List of commits on branch master.
Unverified
052233ffcaf92c93433adb270e4c2d9db7fa3cbe

Merge pull request #11 from tobiasbueschel/patch-1

ttwhitbeck committed 7 years ago
Unverified
fe990d1b7b3623a1285d337034d8dc2cbacc04c5

Update license type

ttobiasbueschel committed 7 years ago
Unverified
0b36692009b030a6267e7702cf81517df5abac29

0.9.0

ttwhitbeck committed 8 years ago
Unverified
bbac39809dcbc9866f474175996648f95ee87bf2

Add comment about jQuery and originalEvent

ttwhitbeck committed 8 years ago
Unverified
64305fabc492c5e2125f53549932c47b10f0fc3d

Merge pull request #9 from alexdrans/master

ttwhitbeck committed 8 years ago
Unverified
2403f7280cbd4cc7efae5d64a5d8534dccf250f9

reverted format changes

aalexdrans committed 8 years ago

README

The README file for this repository.

angular-cropper

Touch-enabled image cropper for AngularJS

Demo

Get it

$ bower install angular-cropper

or

$ npm install angular-cropper

Use it

  • Include files in your html
    • bower_components/angular-file-reader/angular-file-reader.js
    • bower_components/angular-cropper/angular-cropper.js
  • Include tw.directives.cropper in your module dependencies
    • angular.module('myApp', ['tw.directives.cropper']);
  • Place the tw-cropper attribute on a canvas
    • <canvas width="300" height="300" tw-cropper="cropper"></canvas>
  • Give your cropper a source
    • <canvas width="300" height="300" tw-cropper="cropper" source="myFile"></canvas>
    • source must be a File
    • See the demo for one way to get a File to your scope
    • Or use twhitbeck/angular-file-input
  • Get the dataURL of your crop with controller toDataURL method
    • <button ng-click="upload(cropper.toDataURL())">Save</button>
  • That's it!