Skip to content

Generate setter stubs for the Directives #500

@mhevery

Description

@mhevery

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions