你如何设置这样的范围值:
<div ng-controller="MyCtrl">
<my-element ng-repeat="p in people" person='p'></my-element>
</div>
var myApp = angular.module('myApp',[]);
myApp.directive('myElement', function(){
return {
restrict: 'E',
template: '<div>{{ name }}</div> <div>{{ age }}</div>'
}
});
function MyCtrl($scope) {
$scope.people = [{ name: 'Mike', age: 20 },{name: 'Peter', age: 22 }];
}