Controller that wants to dynamically control the loading of submodules
ng-controller="{{myCtrl}}"
But this will cause an error and the system will prompt that myCtrl is not a function.
It should be a rendering priority problem, that is, the ng-controller renders too fast, and the subsequent variable values ????have not yet been obtained.
Please give me some advice, what should I do about this?
ringa_lee
Why do we need to add double brackets? If myCtrl
是個正確controller
, just remove the double brackets and write directly.
Obviously angular parses the parameters of the ngController directive as strings, not expressions!