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

Multiple templateUrls

Open smohammedyasin opened this issue 6 years ago • 2 comments

hello,

is it possible to use multiple templateUrls based

currently i try to access using below code. but not working,

 var Div1= blockUI.instances.get('Div1');
            //stop all playing before load
            Div1.start({
                    templateUrl: '/Scripts/pages/loading.html'
                });
       $timeout(function() {
  // Stop the block after some async operation.
                Div1.stop();
           }, 1000);

 var Div2= blockUI.instances.get('Div2');
            //stop all playing before load
            Div2.start({
                    templateUrl: '/Scripts/pages/loading2.html'
                });
       $timeout(function() {
  // Stop the block after some async operation.
                Div2.stop();
           }, 1000);

smohammedyasin avatar May 16 '18 12:05 smohammedyasin

First you have to Disable auto body block.

Write this code in app.js config file(for disable auto body block). // Disable auto body block blockUIConfig.autoInjectBodyBlock = false;

And then you can change template html anywhere(in config file) like, blockUIConfig.template = '/Scripts/pages/loading1.html'.

Or // Put template for Block messages here. blockUIConfig.template = div class="block-ui-message-container" div class="block-ui-message" span i class="fa fa-circle-o-notch fa-spin" /i  {{ state.message }} /span p (press ESC to cancel) /p /div /div;

Note:(i didn't write < and > in html.) See if this thing workout ! Best Luck.

vilispatel avatar May 21 '18 18:05 vilispatel

@vilispatel Thank you for response,

as per your script's idea, it can be use one template per page, but, in my case i have multiple blocks in one page and i want to show different, different templates

smohammedyasin avatar May 23 '18 11:05 smohammedyasin