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?
PHP中文网2017-05-15 17:00:36
Why do we need to add double brackets? If myCtrl
是个正确controller
, just remove the double brackets and write directly.
巴扎黑2017-05-15 17:00:36
Obviously angular parses the parameters of the ngController directive as strings, not expressions!