Cropping tool for angular
Install through npm:
npm install --save https://github.com/mghiozzi/ng2-img-crop
Import it in your app module;
import { Ng2ImgCropModule } from 'ng2-img-crop';
@NgModule({
...
imports: [
...
Ng2ImgCropModule
]
})
Then import the crop service where you need it:
import { ImageCropService } from 'ng2-img-crop';
...
export class myComponent {
constructor(private imageCropper: ImageCropService){}
}
Methods:
crop (image: HTMLImageElement, startX: number = 0, startY: number = 0, clipWidth: number, clipHeight: number): Promise<string>
MIT