然后在目录执行npm start 浏览器中访问:4200/ 就可以看到示例效果了 ↓
代码如下↓
将ImageCropperModule添加到模块的导入中,若未安装此包,在Windows PowerShell中执行yarn add ngx-image-cropper 即可
1 import { BrowserModule } from \'@angular/platform-browser\'; 2 import { NgModule } from \'@angular/core\'; 3 4 import { AppComponent } from \'./app.component\'; 5 import { ImageCropperjsComponent } from \'./cropperjs/image-cropperjs/image-cropperjs.component\'; 6 import { ImageCropperModule } from \'ngx-image-cropper\'; 7 8 @NgModule({ 9 declarations: [ 10 AppComponent, 11 ImageCropperjsComponent 12 ], 13 imports: [ 14 BrowserModule, ImageCropperModule 15 ], 16 providers: [], 17 bootstrap: [AppComponent] 18 }) 19 export class AppModule { }