angular-block-ui
angular-block-ui copied to clipboard
Element Blocking doesn't work when the requests occur in the controller method
I have a controller that does a GET request in the controller method. On the template I have a blockui element:
I put two breakpoints in the blockui js. One in the blockUi directive factory and one where it intercepts a request and checks the patterns (in the instances.locate function). When I load the page, the controller runs and makes the GET request. The instances.locate breakpoint is hit. After that, the blockUI directive factory breakpoint gets hit. Frustratingly, the Loading... popup covers the whole screen, because the directive isn't getting processed before the request occurs. It should process the directives before it handles the requests, though.
Is there a workaround for this?
Does this problem still occur and if so, can you supply me some example code? Thanks.
Probably the same problem, one way to test is open a modal, use block-ui-pattern and call a request on controller initialize. Requests made after that works like a charm.