来自关于ng-init的Angular文档:
This directive can be abused to add unnecessary amounts of logic into
your templates. There are only a few appropriate uses of ngInit,such
as for aliasing special properties of ngRepeat,as seen in the demo
below; and for injecting data via server side scripting.
任何人都可以解释第二个用例:
…and for injecting data via server side scripting.
具体来说,使用此指令将值从Rails / PHP视图传递给Angular控制器是否合适?
其他方法(使用$location)似乎不必要地复杂化.