From dea6a4593b66ccdc34be45ca843a3f2d804f5997 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Tue, 6 Oct 2015 19:14:45 -0700 Subject: [PATCH] cleanup(core): making @View optional Closes #4566 --- modules/angular2/test/core/linker/integration_spec.ts | 4 ++-- modules/angular2/test/core/linker/view_resolver_spec.ts | 8 ++++---- modules/examples/src/hello_world/index.ts | 2 +- .../transform/template_compiler/compile_data_creator.dart | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/angular2/test/core/linker/integration_spec.ts b/modules/angular2/test/core/linker/integration_spec.ts index bbeee80293..acbdcc2ba6 100644 --- a/modules/angular2/test/core/linker/integration_spec.ts +++ b/modules/angular2/test/core/linker/integration_spec.ts @@ -1701,7 +1701,7 @@ export function main() { inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { tcb.overrideView(MyComp, new ViewMetadata({ template: '', - directives: [ComponentWithTempalte] + directives: [ComponentWithTemplate] })) .createAsync(MyComp) .then((rootTC) => { @@ -2270,7 +2270,7 @@ class DirectiveThrowingAnError { selector: 'component-with-template', directives: [NgFor], template: `No View Decorator:
{{item}}
` }) -class ComponentWithTempalte { +class ComponentWithTemplate { items = [1, 2, 3]; } diff --git a/modules/angular2/test/core/linker/view_resolver_spec.ts b/modules/angular2/test/core/linker/view_resolver_spec.ts index 77a9741f9d..5de294abab 100644 --- a/modules/angular2/test/core/linker/view_resolver_spec.ts +++ b/modules/angular2/test/core/linker/view_resolver_spec.ts @@ -26,15 +26,15 @@ class ComponentWithTemplate { class ComponentWithViewTemplate { } -@Component({selector: 'sample'}) -class ComponentWithoutView { -} - @Component({selector: 'sample', templateUrl: "some template url"}) @View({template: "some template"}) class ComponentWithViewTemplateUrl { } +@Component({selector: 'sample'}) +class ComponentWithoutView { +} + @View({template: "some template"}) class ClassWithView { } diff --git a/modules/examples/src/hello_world/index.ts b/modules/examples/src/hello_world/index.ts index ac390b1643..4b99f4574e 100644 --- a/modules/examples/src/hello_world/index.ts +++ b/modules/examples/src/hello_world/index.ts @@ -1,5 +1,5 @@ import {bootstrap} from 'angular2/bootstrap'; -import {ElementRef, Component, Directive, View, Injectable} from 'angular2/core'; +import {ElementRef, Component, Directive, Injectable} from 'angular2/core'; import {Renderer} from 'angular2/render'; export function main() { diff --git a/modules_dart/transform/lib/src/transform/template_compiler/compile_data_creator.dart b/modules_dart/transform/lib/src/transform/template_compiler/compile_data_creator.dart index 2f091b346e..d591a241a7 100644 --- a/modules_dart/transform/lib/src/transform/template_compiler/compile_data_creator.dart +++ b/modules_dart/transform/lib/src/transform/template_compiler/compile_data_creator.dart @@ -195,7 +195,6 @@ class _DirectiveDependenciesVisitor extends Object /// reflector. @override Object visitInstanceCreationExpression(InstanceCreationExpression node) { -// if (_isViewAnnotation(node)) { if (_isViewAnnotation(node) || _isComponentAnnotation(node)) { compileData = new NormalizedComponentWithViewDirectives( null, []);