Here how I proceeded:
-
Install cropperjs (*** Update: Install version 0.7.2. Later version, like 0.8.1, doesn’t seems to be compatible anymore with my “how to”)
sudo npm install cropperjs --save
-
Install the typescript definition for cropperjs
typings install dt~cropperjs --save --global
-
In your ts class file, include cropperjs
import * as Cropper from ‘croppers’;
-
And finally declare a cropper variable in your class
private cropper:cropperjs.Cropper;
-
(Update) Also don’t forget to include the cropperjs css file in your project otherwise the cropperjs element not gonna be displayed correctly at runtime. Therefor add in your app.core.scss
@import “cropper.scss”;
For the rest you could go on with my previous post.