angular-block-ui icon indicating copy to clipboard operation
angular-block-ui copied to clipboard

blockBrowserNavigation

Open miteshkamat27 opened this issue 10 years ago • 2 comments

I am using angucomplete-alt in which when I enter a keyword for search I make http request . So, I am showing blockUI loader till I get response. But during loading if I press backspace or delete I am getting navigated back to previous page. For this, I used blockBrowserNavigation= true but it seems to be not working for me.

miteshkamat27 avatar Jul 28 '15 18:07 miteshkamat27

requestFilter

Allows you to specify a filter function to exclude certain ajax requests from blocking the user interface. The function is passed the Angular request config object. The blockU service will ignore requests when the function returns false.

// Tell the blockUI service to ignore certain requests
blockUIConfig.requestFilter = function(config) {
  // If the request starts with '/api/quote' ...
  if(config.url.match(/^\/api\/quote($|\/).*/)) {
    return false; // ... don't block it.
  }
};

ahmed-abdulmoniem avatar Aug 13 '15 10:08 ahmed-abdulmoniem

requestFilter

Allows you to specify a filter function to exclude certain ajax requests from blocking the user interface. The function is passed the Angular request config object. The blockU service will ignore requests when the function returns false.

// Tell the blockUI service to ignore certain requests
blockUIConfig.requestFilter = function(config) {
  // If the request starts with '/api/quote' ...
  if(config.url.match(/^\/api\/quote($|\/).*/)) {
    return false; // ... don't block it.
  }
};

Perfect. I was also using angucomplete-alt and at the same time using block-ui module. When ever angucomplete-alt sends an AJAX request it has been cancelled immediately. After using requestFilter to ignore the autocomplete AJAX request everything worked.

rajithwijepura avatar May 07 '19 08:05 rajithwijepura