This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was 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.