angular-once
angular-once copied to clipboard
angular-once and directive scope parameters
I'd like to use a angular-once with scope parameters.
Suppose I need to pass some value to my directives:
<div ng-repeat="item in items">
<directive-one ng-if="item.type === 'directive1'" value="{{item.value}}"></directive-one>
<directive-two ng-if="item.type === 'directive2'" value="{{item.value}}"></directive-two>
</div>
app.directive('directiveOne', function() {
return {
scope: {
value: '@'
},
restrict: 'E',
template: '<p once-text="value"></p>'
}
});
This will setup a watch using {{item.value}} and scope: value. How can I avoid it?
Thanks!