简体   繁体   中英

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

In my 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
  • i don't know what is the issue the block ui is not starting
  • maybe the issue is related to angular version or not?
  • Angular version i am using is 7.

If ng-block-ui directive (*blockUI = "'your-variable'") isn't working in ANGULAR 7, 8 OR 9

Then here is the solution.

First of all, if you followed this mentioned docs of 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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