0

Is it possible to load the angularjs controller late? like...

function doLateLoad(){ app.controller('ctrl', function ($scope) {}) }
doLateLoad();

I get ctrl is not found error for some reason. If I directly load it w/o including into a function, it works well.

2
  • The code you provided is not 'late'. It's absolutely same as app.controller(...). Please, provide stackoverflow.com/help/mcve that replicates the problem. Commented Feb 11, 2018 at 23:52
  • 1
    there are modules that make attempts to enable "Lazy Loading" which seems like what you are trying to ask here.... check out ocLazyLoad for example. Commented Feb 12, 2018 at 0:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.