feat(dart/transform): Generate setter stubs.

Generate calls to Reflector#registerSetters from the information in
provided `Directive#bind` values.

This is only an initial attempt - it covers only the most basic values
of `bind`.

Closes #780
This commit is contained in:
Tim Blasi
2015-02-23 17:38:34 -08:00
committed by Misko Hevery
parent 1376e49ea0
commit 50a74b1d91
6 changed files with 276 additions and 117 deletions

View File

@ -0,0 +1,26 @@
library angular2.src.transform.generated;
import 'package:angular2/src/reflection/reflection.dart' show reflector;
import 'bar.dart' as i0;
import 'package:angular2/src/core/annotations/annotations.dart' as i1;
setupReflection() {
reflector
..registerType(i0.MyComponent, {
"factory": () => new i0.MyComponent(),
"parameters": const [const []],
"annotations": const [
const i1.Component(
selector: 'soup', componentServices: const [i0.ToolTip])
]
})
..registerType(i0.ToolTip, {
"factory": () => new i0.ToolTip(),
"parameters": const [const []],
"annotations": const [
const i1.Decorator(
selector: '[tool-tip]', bind: const {'text': 'tool-tip'})
]
})
..registerSetters({"text": (i0.ToolTip o, String value) => o.text = value});
}