angularjs - how to pass directive attribute to directive template? -
i'm have code:
<div ng-repeat="param in item.parameters"> <rating param_item="{{param}}"></rating> </div>
how can pass given attribute directive template?
personally, creating child scope element directives: http://plnkr.co/edit/dz7fczat4kdrda869rwm?p=preview
app.directive('rating', function() { return { restrict: 'e', scope: { paramitem: '@' }, link: function(scope, element, attr){ console.log(scope.paramitem); } } });
there couple other ways too, depending on how expect directive work.
Comments
Post a Comment