Chakravarthi Bharathi
Chakravarthi Bharathi

Reputation: 234

Dojo aspect not working for ready

I want to have an aspect which does some task after dojo ready is called. The code is given below,

aspect.after(dojo, "ready", function(deferred) {
    loader.hide();
});

The loader.hide() is not called after the page ready function is called. But the above code is working good with xhr instead of ready. Will aspects work for dojo/ready ? Am I missing something here?

Thanks in advance for your help

===============================================

After few trial and errors, got this working by using

dojo.ready(function() {
});

Wanted to know why the aspect is not working with

 require(["dojo/ready"], function(ready) {
        ready(function() {
        });  
 });

Upvotes: 0

Views: 314

Answers (1)

Lucian Depold
Lucian Depold

Reputation: 2017

Try using dojo/domReady too. You are not allowed to map domReady to any variable, so that is why it has to appear at the end:

require(["dojo/ready","dojo/domReady!"],function(ready) {
    ready(function()  {
     // Your code
    });

});

Upvotes: 1

Related Questions