cleanup(core): making @View optional

Closes #4566
This commit is contained in:
vsavkin 2015-10-06 19:14:45 -07:00 committed by Victor Savkin
parent d38689677c
commit dea6a4593b
4 changed files with 7 additions and 8 deletions

View File

@ -1701,7 +1701,7 @@ export function main() {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<component-with-template></component-with-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: <div *ng-for="#item of items">{{item}}</div>`
})
class ComponentWithTempalte {
class ComponentWithTemplate {
items = [1, 2, 3];
}

View File

@ -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 {
}

View File

@ -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() {

View File

@ -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, <CompileDirectiveMetadata>[]);