angular-once icon indicating copy to clipboard operation
angular-once copied to clipboard

angular-once and directive scope parameters

Open mathpaquette opened this issue 8 years ago • 0 comments

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!

mathpaquette avatar Apr 04 '16 00:04 mathpaquette