小编wal*_*ali的帖子

ng2-toastr无法在角度2中工作

我想在我的角度2应用程序中使用ng2-toastr.我已按照所有说明操作,但toastr无法显示没有任何控制台错误.我还读过一些地方,ng-toastr不再适用于角度2,但没有找到任何有效的文档.我搜索了类似的问题,但没有找到任何合适的答案来解决我的问题.任何帮助,将不胜感激.

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';
import{ ToastModule} from 'ng2-toastr/ng2-toastr';
import { BrowserAnimationsModule} from '@angular/platform-
browser/animations';
import "hammerjs"

import { CoreModule } from './core/core.module';

import { MODULE_ROUTES, MODULE_COMPONENTS } from './app.router'

@NgModule({
  declarations: [
    MODULE_COMPONENTS
],
imports: [
   BrowserModule,
   FormsModule,
   HttpModule,
   RouterModule.forRoot(MODULE_ROUTES),
   BrowserAnimationsModule,
   CoreModule,
   ToastModule.forRoot()
],
providers: [ ],
bootstrap: [MODULE_COMPONENTS]
})
export class …
Run Code Online (Sandbox Code Playgroud)

angular-cli angular-toastr angular

2
推荐指数
1
解决办法
4236
查看次数

标签 统计

angular ×1

angular-cli ×1

angular-toastr ×1