Revert "test(router): remove View decorator in router link fixtures"

This reverts commit 422a7b18f6.
This commit is contained in:
Alex Rickabaugh 2015-11-23 16:34:06 -08:00
parent c5294c77d9
commit a3353a5e28
1 changed files with 21 additions and 27 deletions

View File

@ -21,7 +21,7 @@ import {NumberWrapper} from 'angular2/src/facade/lang';
import {PromiseWrapper} from 'angular2/src/facade/async'; import {PromiseWrapper} from 'angular2/src/facade/async';
import {ListWrapper} from 'angular2/src/facade/collection'; import {ListWrapper} from 'angular2/src/facade/collection';
import {provide, Component, DirectiveResolver} from 'angular2/core'; import {provide, Component, DirectiveResolver, View} from 'angular2/core';
import {SpyLocation} from 'angular2/src/mock/location_mock'; import {SpyLocation} from 'angular2/src/mock/location_mock';
import { import {
@ -386,17 +386,15 @@ class MyComp {
name; name;
} }
@Component({ @Component({selector: 'user-cmp'})
selector: 'user-cmp', @View({template: "hello {{user}}"})
template: "hello {{user}}"
})
class UserCmp { class UserCmp {
user: string; user: string;
constructor(params: RouteParams) { this.user = params.get('name'); } constructor(params: RouteParams) { this.user = params.get('name'); }
} }
@Component({ @Component({selector: 'page-cmp'})
selector: 'page-cmp', @View({
template: template:
`page #{{pageNumber}} | <a href="hello" [router-link]="[\'../Page\', {number: nextPage}]">next</a>`, `page #{{pageNumber}} | <a href="hello" [router-link]="[\'../Page\', {number: nextPage}]">next</a>`,
directives: [RouterLink] directives: [RouterLink]
@ -410,8 +408,8 @@ class SiblingPageCmp {
} }
} }
@Component({ @Component({selector: 'page-cmp'})
selector: 'page-cmp', @View({
template: template:
`page #{{pageNumber}} | <a href="hello" [router-link]="[\'Page\', {number: nextPage}]">next</a>`, `page #{{pageNumber}} | <a href="hello" [router-link]="[\'Page\', {number: nextPage}]">next</a>`,
directives: [RouterLink] directives: [RouterLink]
@ -425,17 +423,13 @@ class NoPrefixSiblingPageCmp {
} }
} }
@Component({ @Component({selector: 'hello-cmp'})
selector: 'hello-cmp', @View({template: 'hello'})
template: 'hello'
})
class HelloCmp { class HelloCmp {
} }
@Component({ @Component({selector: 'hello2-cmp'})
selector: 'hello2-cmp', @View({template: 'hello2'})
template: 'hello2'
})
class Hello2Cmp { class Hello2Cmp {
} }
@ -443,8 +437,8 @@ function parentCmpLoader() {
return PromiseWrapper.resolve(ParentCmp); return PromiseWrapper.resolve(ParentCmp);
} }
@Component({ @Component({selector: 'parent-cmp'})
selector: 'parent-cmp', @View({
template: `{ <a [router-link]="['./Grandchild']" class="grandchild-link">Grandchild</a> template: `{ <a [router-link]="['./Grandchild']" class="grandchild-link">Grandchild</a>
<a [router-link]="['./BetterGrandchild']" class="better-grandchild-link">Better Grandchild</a> <a [router-link]="['./BetterGrandchild']" class="better-grandchild-link">Better Grandchild</a>
<router-outlet></router-outlet> }`, <router-outlet></router-outlet> }`,
@ -458,8 +452,8 @@ class ParentCmp {
constructor(public router: Router) {} constructor(public router: Router) {}
} }
@Component({ @Component({selector: 'book-cmp'})
selector: 'book-cmp', @View({
template: `<a href="hello" [router-link]="[\'./Page\', {number: 100}]">{{title}}</a> | template: `<a href="hello" [router-link]="[\'./Page\', {number: 100}]">{{title}}</a> |
<router-outlet></router-outlet>`, <router-outlet></router-outlet>`,
directives: ROUTER_DIRECTIVES directives: ROUTER_DIRECTIVES
@ -470,8 +464,8 @@ class BookCmp {
constructor(params: RouteParams) { this.title = params.get('title'); } constructor(params: RouteParams) { this.title = params.get('title'); }
} }
@Component({ @Component({selector: 'book-cmp'})
selector: 'book-cmp', @View({
template: `<a href="hello" [router-link]="[\'Page\', {number: 100}]">{{title}}</a> | template: `<a href="hello" [router-link]="[\'Page\', {number: 100}]">{{title}}</a> |
<router-outlet></router-outlet>`, <router-outlet></router-outlet>`,
directives: ROUTER_DIRECTIVES directives: ROUTER_DIRECTIVES
@ -482,8 +476,8 @@ class NoPrefixBookCmp {
constructor(params: RouteParams) { this.title = params.get('title'); } constructor(params: RouteParams) { this.title = params.get('title'); }
} }
@Component({ @Component({selector: 'book-cmp'})
selector: 'book-cmp', @View({
template: `<a href="hello" [router-link]="[\'Book\', {number: 100}]">{{title}}</a> | template: `<a href="hello" [router-link]="[\'Book\', {number: 100}]">{{title}}</a> |
<router-outlet></router-outlet>`, <router-outlet></router-outlet>`,
directives: ROUTER_DIRECTIVES directives: ROUTER_DIRECTIVES
@ -494,8 +488,8 @@ class AmbiguousBookCmp {
constructor(params: RouteParams) { this.title = params.get('title'); } constructor(params: RouteParams) { this.title = params.get('title'); }
} }
@Component({ @Component({selector: 'aux-cmp'})
selector: 'aux-cmp', @View({
template: template:
`<a [router-link]="[\'./Hello\', [ \'Aside\' ] ]">aside</a> | `<a [router-link]="[\'./Hello\', [ \'Aside\' ] ]">aside</a> |
<router-outlet></router-outlet> | aside <router-outlet name="aside"></router-outlet>`, <router-outlet></router-outlet> | aside <router-outlet name="aside"></router-outlet>`,