fix(transformer): Support prefixed annotations in the transformer.

closes https://github.com/angular/angular/issues/2754
This commit is contained in:
Jacob MacDonald
2015-07-07 09:03:11 -07:00
parent 569766fa8b
commit 9e1158de4f
7 changed files with 202 additions and 7 deletions

View File

@ -36,8 +36,13 @@ class ViewDefinitionEntry {
String _getComponentId(AssetId assetId, String className) => '$className';
// TODO(kegluenq): Improve this test.
bool _isViewAnnotation(InstanceCreationExpression node) =>
'${node.constructorName.type}' == 'View';
bool _isViewAnnotation(InstanceCreationExpression node) {
var constructorName = node.constructorName.type.name;
if (constructorName is PrefixedIdentifier) {
constructorName = constructorName.identifier;
}
return constructorName.name == 'View';
}
/// Creates [ViewDefinition] objects for all `View` `Directive`s defined in
/// `entryPoint`.