在我的应用程序中,我试图集成托斯特尔
作为其中的一部分,我已经整合了package.json和angular.json。到目前为止,当我集成worked.but时,应用程序app.module.ts
app.module.ts
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
FormsModule,
ReactiveFormsModule,
ToastrModule.forRoot({
timeOut: 1000,
positionClass: 'toast-bottom-right'
})
],
export class AppModule { }我得到了以下错误。
@import must precede all other statements (besides @charset)
WARNING in Entry point 'ngx-toastr' contains deep imports into 'C:/Users/angular-frontend/node_modules/@angular/compiler/src/core'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
ERROR in Cannot read property 'push' of undefined发布于 2020-03-09 07:34:34
我已经解决了这个问题
ng update @angular/cli @angular/core --allow-dirty
发布于 2020-03-06 13:57:28
用@NgModule装饰器来装饰您的进口商品:
import {ToastrModule} from 'ngx-toastr';
@NgModule({
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
FormsModule,
ReactiveFormsModule,
ToastrModule.forRoot({
timeOut: 1000,
positionClass: 'toast-bottom-right'
})
],
})
export class AppModule {}https://stackoverflow.com/questions/60565327
复制相似问题