feat(dart/transform) Allow ctor stubs to be tree shaken
Change the method used to discover Directive annotated classes to ensure that the Dart code can be tree shaken. Closes #497 Closes $\x23736
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
library bar;
|
||||
|
||||
import 'package:angular2/src/core/annotations/annotations.dart';
|
||||
import 'package:angular2/src/core/annotations/template.dart';
|
||||
|
||||
@Component(selector: '[soup]')
|
||||
@Template(inline: 'Salad')
|
||||
class MyComponent {
|
||||
MyComponent();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:angular2/src/reflection/reflection.dart' show reflector;
|
||||
import 'bar.dart' as i0;
|
||||
import 'package:angular2/src/core/annotations/annotations.dart' as i1;
|
||||
import 'package:angular2/src/core/annotations/template.dart' as i2;
|
||||
import 'index.dart' as i3;
|
||||
|
||||
main() {
|
||||
reflector
|
||||
..registerType(i0.MyComponent, {
|
||||
"factory": () => new i0.MyComponent(),
|
||||
"parameters": const [const []],
|
||||
"annotations": const [
|
||||
const i1.Component(selector: '[soup]'),
|
||||
const i2.Template(inline: 'Salad')
|
||||
]
|
||||
});
|
||||
i3.main();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
library web_foo;
|
||||
|
||||
import 'package:angular2/src/core/application.dart';
|
||||
import 'bar.dart';
|
||||
|
||||
void main() {
|
||||
bootstrap(MyComponent);
|
||||
}
|
||||
Reference in New Issue
Block a user