angular-cropperjs
CropperJS integration for Angular 2/4
How to use
1- Install the library:
$ npm install angular-cropperjs --save
2- Import and load AngularCropperjsModule
in the module you want to use, for example AppModule
:
;; ; //// Import angular-cropperjs;
3- Use the component in your template like this:
<!-- You can now use angular-cropper component in app.component.html -->
Using CropperJS methods:
Use @ViewChild in your component to get the element:
In your app.component.html
And in your app.component.ts
//// Import AngularCropperjsComponent; //// Get with @ViewChild@ public angularCropper: AngularCropperjsComponent;
Then just call the CropperJS method you want:
anywhere in your app.component.ts
//// Lets try to zoomthisangularCroppercropper;
Development
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint
License
MIT © Matheus Davidson