You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and in some point I will dynamically load this module:
require.ensure(['dashboard'],function(){
....})
In the dev mode, I can see that ngtemplate-loader had generated the correct code, but I can not get the html from $templateCache.get(), then I hack the source code of ngTemplate-loader, add some debug code ( like alert(1) ) into the callback of module( 'x' ).run(), but the hack code is not executed.
I think the problem is that angular.module.run will not be executed again after angular finished its initialization.
I did a little test below:
angular.module('app',[]);angular.module('app').run(function(){console.log('run 1');});// output: "run 1"setTimeout(function(){angular.module('app').run(function(){console.log('run 2');// never executed.});},1000);
The text was updated successfully, but these errors were encountered:
Hi, I'm trying to build a SPA which load controllers and templates asynchronously. I have a dashboard module like below:
and in some point I will dynamically load this module:
In the dev mode, I can see that ngtemplate-loader had generated the correct code, but I can not get the html from
$templateCache.get()
, then I hack the source code ofngTemplate-loader
, add some debug code ( likealert(1)
) into the callback ofmodule( 'x' ).run()
, but the hack code is not executed.I think the problem is that angular.module.run will not be executed again after angular finished its initialization.
I did a little test below:
The text was updated successfully, but these errors were encountered: