Skip to content
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.

angular-once and directive scope parameters #38

Open
mathpaquette opened this issue Apr 4, 2016 · 0 comments
Open

angular-once and directive scope parameters #38

mathpaquette opened this issue Apr 4, 2016 · 0 comments

Comments

@mathpaquette
Copy link

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant