简体   繁体   English

Angular ng-block-ui 在 angular 7 中不起作用?

[英]Angular ng-block-ui is not working in angular 7?

In my app.module.ts在我的 app.module.ts

import { BlockUIModule } from 'ng-block-ui';
imports: [
    BrowserModule,
    BlockUIModule.forRoot(),
]

In my dashboard component在我的仪表板组件中

import { BlockUI, NgBlockUI } from 'ng-block-ui';

export class DashboardComponent implements OnInit {

@BlockUI() blockUI : NgBlockUI;

 ngOnInit() {
    this.blockUI.start()
 }

}
  • Block Ui is not adding element in the Html块 Ui 未在 Html 中添加元素
  • i don't know what is the issue the block ui is not starting我不知道块 ui 未启动的问题是什么
  • maybe the issue is related to angular version or not?也许问题与角度版本有关?
  • Angular version i am using is 7.我使用的 Angular 版本是 7。

If ng-block-ui directive (*blockUI = "'your-variable'") isn't working in ANGULAR 7, 8 OR 9如果 ng-block-ui 指令 (*blockUI = "'your-variable'") 在 ANGULAR 7、8 或 9 中不起作用

Then here is the solution.那么这里是解决方案。

First of all, if you followed this mentioned docs of ng-block-ui.首先,如果你遵循了 ng-block-ui 的这个提到的文档。 And even it isn't working,即使它不起作用,

Then you need to install :然后你需要安装:

npm install ng-block-ui@next

this dependency in your angular project.您的 angular 项目中的这种依赖关系。

And if you are getting this error :如果您收到此错误:

ng-block-ui: TypeError: Cannot read property 'localName' of null
at ng-block-ui.js:878

Then you need to install :然后你需要安装:

npm install ng-block-ui@next

official bug link官方错误链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM