Note that there are some explanatory texts on larger screens.

plurals
  1. USDeepak Nulu
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COThank you for such a quick response. If what I am attempting goes against the grain, I am a bit saddened (AngularJS is nonetheless an awesome framework). A directive is meant to be a reusable component. When it is written, the author should not have to worry about whether it will be used with an `ng-repeat` or not. Maybe when it is first written, it is never used with `ng-repeat`. And some time in the future, it might get used with `ng-repeat`, and at that point in time, it should just work without a rewrite. Hopefully a future release of AngularJS will make this possible.
      singulars
    2. COMy issue: Writing to a 2-way data binding in a custom directive with isolate-scope fails with `ng-repeat`. Your plunker uses 2-way data binding, but it only reads the bound variable; it does not write to a bound variable. I don't need to write to the variable pointing to the current iteration (`val` in your plunker), but I have other variables that I bind to in my directive's isolate-scope and I need to be able to modify those variables from within my directive. For example, in my fiddle (linked to in my question), I need to modify `ioSelected`, and that does not work when I use `ng-repeat`.
      singulars
    3. COAlso, I think it is important for a component (directive) to be able to change in the future without breaking the code that uses it, especially if the component is just adding behavior without changing its "API" (i.e. it does not need additional bindings to support the new behavior). The new behavior might need an isolate-scope where none was needed before in order to store component-specific state. So I think it is not ideal to have to decide what type of scope to use for a "component directive" based on the current usage patterns of that component. </soapbox>
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload