When transformer comes across a directive it needs to extract the setter stubs from the binding.
Given this code:
@Decorator(
selector: '[tool-tip]',
bind: const {
"tool-tip": "text"
}
)
class TooltTip {
String text;
}
From the above example the transformer needs to extract all of the bindings and generate:
reflector.registerSetter({
"text": (TooltTip o, String value) => o.text = value
});
This allows angular to write changes from the change detection into the directive bindings.
NOTE: If there are more than one Directive which has the same setter, we may have to use nearest common supper class for the stub. (We can devise a more accurate mechanism later)
When transformer comes across a directive it needs to extract the setter stubs from the binding.
Given this code:
From the above example the transformer needs to extract all of the
bindings and generate:This allows angular to write changes from the change detection into the directive bindings.
NOTE: If there are more than one Directive which has the same setter, we may have to use nearest common supper class for the stub. (We can devise a more accurate mechanism later)