angularjs - Speeding up page load time by delaying execution of directive link function -


Some of my instructions take enough time to execute the link function. So this page load time is delayed

To make it fast, the window is intended to execute the linkfn. Load event

The approach that I am planning to do

  directive ('Mydirective', function () (limited: 'a', scope: {}, link: function (Field, element, etters) {var unwatcher = scope. $ Watch ("$ viewcontentloaded", function () {unwatcher); // real link function that takes a lot of time to execute.}}}}  

BTW does not guarantee execution after window using $ timeout (linkfn, 0).

checkout bindos and more Try this if you already have not

instead of templateUrl: instead of your template html Template:

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -