This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
Add ProtoAware to change detection #917
Closed
Description
In order to support ng-repeat
and to not have ProtoMap
which forwards to parent map we need a class which can at 'compile-time' answer if we can dereference a nam.
abstract class ProtoAware {
Object parent;
bool hasProperty(String name);
operator[]
}
This way a repeater can define:
class RepeatContext extends ProtoAware {
Object parent;
String itemName;
hasProperty(name) => name == itemName || name == '$index';
}
This way the change detection system on assignment can query the object and determine if the object understand a field. If it does not it checks the parent. This way it is possible to emulate prototypical inheritance without reflection.
Metadata
Metadata
Assignees
Labels
No labels