简单的问题。如何在html中设置范围值,在我的控制器中读取?
<div ng-controller="MyController"> <div name='my_map' scope-myVar='Richmond,VA' scope-someOther='test'> </div> </div> #controller MyController = function($scope){ alert($scope.myVar) };
JSFiddle:http://jsfiddle.net/ncapito/YdQcX/