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

One-way bindings + shallow watching #14039

Closed

Description

When the PR #13928 (one-way bindings) was discussed, the shallow watching (using $watchCollection) wasn't implemented as it wasn't clear what the use case is. Seems like I've found a use case.

Suppose we have a component:

app.component('myList', {
  template: '...',
  bindings: { items: '<' }
});

and it's used like this:

<my-list items="items|orderBy:'title'"></my-list>

Can you see what's going on here? The orderBy filter returns a new array every time it's called, so we get $rootScope:infdig. Plunker.

Changing the type of the binding to =* makes it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions