一是修改源码,二是自己实现,然而这两种方法都比较麻烦,比较好的解决方案是利用现有的开源代码,搜索ionic的相关组件寥寥无几,这个时候转换下思路,搜索angular的相关组件会发现有几个,经过比较后觉得ngx-toastr image.png ionic3集成使用ngx-toastr 根据Github上的文档说明,进行如下步骤: 安装组件 npm install ngx-toastr --save npm install BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ToastrModule } from 'ngx-toastr ; } } 防止污染ionic自带的toast样式 ngx-toastr的样式刚好和ionic都用到了.toast-container的class,所以会影响,此时,把toastr.min.css中的 ngx-toastr把toasts放进自定义容器 默认toasts全局显示,如果想限定在某个div或容器里面,使得该容器不可见时不让toast干扰到其它标签,就可以利用ToastContainerModule
app.error-handler.ts: import { ErrorHandler } from '@angular/core'; import { ToastrService } from 'ngx-toastr ErrorHandler, Injectable, Injector, Inject } from '@angular/core'; import { ToastrService, Toast } from 'ngx-toastr Injectable, Injector, Inject, NgZone } from '@angular/core'; import { ToastrService, Toast } from 'ngx-toastr Injectable, Injector, Inject, NgZone } from '@angular/core'; import { ToastrService, Toast } from 'ngx-toastr
/models/tv-show'; import { Subscription } from 'rxjs/Subscription'; import { ToastrService } from 'ngx-toastr /models/tv-show'; import { Subscription } from 'rxjs/Subscription'; import { ToastrService } from 'ngx-toastr /models/tv-show'; import { Subscription } from 'rxjs/Subscription'; import { ToastrService } from 'ngx-toastr /models/tv-show'; import { Subscription } from 'rxjs/Subscription'; import { ToastrService } from 'ngx-toastr
7.1.0", "ngx-echarts": "^4.0.1", "ngx-print": "^1.2.0-beta.2", "ngx-quill": "^7.0.2", "ngx-toastr
包被植入相同恶意代码;移动与 Web 开发核心工具超 30 个@nativescript-community系列核心库(用于跨平台应用开发)、Angular 生态关键包(如ngx-bootstrap、ngx-toastr
ng-select ngx-formly ngx-progressbar ngx-translate ngx-toastr photoviewer
/shared/services/auth.service'; import { User } from 'oidc-client'; import { ToastrService } from 'ngx-toastr