简体   繁体   中英

Angular 2 automatically block ui for each http request

I am using angular 2. I need to block UI on every HTTP request (get, post, ...) but I need it done automatically not manually by calling start before HTTP request begin and stop at the end.

For angular 1.x there is plugin that does it.

can anyone guide me?

Yes by implementing a canDeactivate guard in your component. Follow the documentation, they explain the way to achieve this

Hope it's help.

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