http://jsfiddle.net/x3azn/CqkhN/1/
Some reason I am getting expression Uundefined function for
CtrlName as VirtualCtrlName
ng-controller should take a function, so how does it work?
http://jsfiddle.net/x3azn/CqkhN/1/
Some reason I am getting expression Uundefined function for
CtrlName as VirtualCtrlName
ng-controller should take a function, so how does it work?
您的示例的清理版本:http: //jsfiddle.net/CqkhN/4/
您的代码中的一些要点:
ng-controller="ControllerName"
(我猜你把它混在一起了ng-repeat="array as arrayItem"
)$scope
应该注入控制器$scope
可以仅按名称在视图中访问属性:$scope.foo (in controller) => {{foo}} (in view)
考虑完成这个简短的教程,以便更好地使用 Angular。祝你好运 ;-)
编辑@user2167582 对于我上面的无知和误导性答案,我深表歉意,但您的问题的解决方案非常简单。正如@MarkRajcok 所说,这些实验性功能是可用的with 1.1.5
。因此,只需在您的代码 1.1.5 而不是 1.0.6 中包含正确的版本。