实际上,我们正在努力避免在文件上传过程中阻止用户进行其他操作。 如果在angular中使用rxjs没有在5秒内完成api,我如何显示toastr并隐藏加载器。 uploadFile() {
this.service.uploadFile(data)
.pipe(
//i am looking for operator which will wait 5 sec if and then hide the loader and show the toastr
)
.subscribe(() => {
this.toastr.succe
我正在开发一个有角12.2.4的网页应用程序。
我试图使用ngx库(14.2.1节)在HTTP错误上显示通知祝酒词。使用角HTTP拦截器功能,我试图将ToasterService注入我的自定义拦截器类,但只得到以下错误:
ERROR TypeError: this._appRef.attachView is not a function
at Ke.attachComponentPortal (ngx-toastr.mjs:280)
at Ke.attach (ngx-toastr.mjs:79)
at tt.attach (ngx-toastr.mjs:310)
我有最新版本的"rxjs": "^6.0.0"和@angular/cli": "~6.0.8",当我运行ng serve时,我收到以下编译错误-
ERROR in node_modules/ng2-toastr/src/toast-container.component.d.ts(1,48):
/node_modules/@angular/core/core"' has no exported member'AnimationTransitionEvent'.
imported toastermodu
我有一个angular7应用程序,它直接在本地环境中运行,没有错误。然后,我将angular应用程序的构建(通过使用ng build命令)上传到Aws S3,这也很好用。但是,当我将产品构建(通过使用命令ng build --prod --aot)上传到Aws S3时,它抛出了如下错误 TypeError: this.router.events.filter is not a function 我在我的整个项目中搜索了这个this.router.events.filter,并注释掉了那个部分,然后在本地机器上再次运行该应用程序,所以它工作得很好,但是当我再次上传该应用程序的生产版本时,它仍然
我已经全局安装了Angular CLI: 9.1.12。如果我试图从我的根应用程序运行ng serve,它会抛出以下错误: This version of CLI is only compatible with Angular versions ^8.0.0-beta || >=8.0.0 <9.0.0,
but Angular version 9.1.13 was found instead. 我尝试更改全局CLI版本,但没有成功。 package.json {
"name": "my-app",
"version": &