chore(core): remove @View annotation

Closes #7495
This commit is contained in:
Brian Ford
2016-03-08 13:36:48 -08:00
parent 095db673c5
commit f9fb72fb0e
85 changed files with 588 additions and 599 deletions

View File

@ -16,43 +16,47 @@ import {
import {Injectable, provide} from 'angular2/core';
import {NgIf} from 'angular2/common';
import {Directive, Component, View, ViewMetadata} from 'angular2/src/core/metadata';
import {Directive, Component, ViewMetadata} from 'angular2/src/core/metadata';
@Component({selector: 'child-comp'})
@View({template: `<span>Original {{childBinding}}</span>`, directives: []})
@Component(
{selector: 'child-comp', template: `<span>Original {{childBinding}}</span>`, directives: []})
@Injectable()
class ChildComp {
childBinding: string;
constructor() { this.childBinding = 'Child'; }
}
@Component({selector: 'child-comp'})
@View({template: `<span>Mock</span>`})
@Component({selector: 'child-comp', template: `<span>Mock</span>`})
@Injectable()
class MockChildComp {
}
@Component({selector: 'parent-comp'})
@View({template: `Parent(<child-comp></child-comp>)`, directives: [ChildComp]})
@Component({
selector: 'parent-comp',
template: `Parent(<child-comp></child-comp>)`,
directives: [ChildComp]
})
@Injectable()
class ParentComp {
}
@Component({selector: 'my-if-comp'})
@View({template: `MyIf(<span *ngIf="showMore">More</span>)`, directives: [NgIf]})
@Component({
selector: 'my-if-comp',
template: `MyIf(<span *ngIf="showMore">More</span>)`,
directives: [NgIf]
})
@Injectable()
class MyIfComp {
showMore: boolean = false;
}
@Component({selector: 'child-child-comp'})
@View({template: `<span>ChildChild</span>`})
@Component({selector: 'child-child-comp', template: `<span>ChildChild</span>`})
@Injectable()
class ChildChildComp {
}
@Component({selector: 'child-comp'})
@View({
@Component({
selector: 'child-comp',
template: `<span>Original {{childBinding}}(<child-child-comp></child-child-comp>)</span>`,
directives: [ChildChildComp]
})
@ -62,8 +66,7 @@ class ChildWithChildComp {
constructor() { this.childBinding = 'Child'; }
}
@Component({selector: 'child-child-comp'})
@View({template: `<span>ChildChild Mock</span>`})
@Component({selector: 'child-child-comp', template: `<span>ChildChild Mock</span>`})
@Injectable()
class MockChildChildComp {
}
@ -78,14 +81,20 @@ class MockFancyService extends FancyService {
value: string = 'mocked out value';
}
@Component({selector: 'my-service-comp', bindings: [FancyService]})
@View({template: `injected value: {{fancyService.value}}`})
@Component({
selector: 'my-service-comp',
bindings: [FancyService],
template: `injected value: {{fancyService.value}}`
})
class TestBindingsComp {
constructor(private fancyService: FancyService) {}
}
@Component({selector: 'my-service-comp', viewProviders: [FancyService]})
@View({template: `injected value: {{fancyService.value}}`})
@Component({
selector: 'my-service-comp',
viewProviders: [FancyService],
template: `injected value: {{fancyService.value}}`
})
class TestViewBindingsComp {
constructor(private fancyService: FancyService) {}
}