chore(docs): remove @View decorator from examples in docs

Closes #4666
This commit is contained in:
Alex Eagle 2015-10-11 07:41:19 -07:00 committed by Alex Eagle
parent 62005dd127
commit b96784756c
36 changed files with 181 additions and 263 deletions

View File

@ -51,9 +51,7 @@ export {URLSearchParams} from './src/http/url_search_params';
* *
* @Component({ * @Component({
* selector: 'app', * selector: 'app',
* providers: [HTTP_PROVIDERS] * providers: [HTTP_PROVIDERS],
* })
* @View({
* template: ` * template: `
* <div> * <div>
* <h1>People</h1> * <h1>People</h1>
@ -183,9 +181,7 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS;
* *
* @Component({ * @Component({
* selector: 'app', * selector: 'app',
* providers: [JSONP_PROVIDERS] * providers: [JSONP_PROVIDERS],
* })
* @View({
* template: ` * template: `
* <div> * <div>
* <h1>People</h1> * <h1>People</h1>

View File

@ -41,15 +41,14 @@ import {BaseException} from 'angular2/src/core/facade/exceptions';
* ## Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm)) * ## Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))
* *
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import { * import {
* ROUTER_DIRECTIVES, * ROUTER_DIRECTIVES,
* ROUTER_PROVIDERS, * ROUTER_PROVIDERS,
* RouteConfig * RouteConfig
* } from 'angular2/router'; * } from 'angular2/router';
* *
* @Component({...}) * @Component({directives: [ROUTER_DIRECTIVES]})
* @View({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([ * @RouteConfig([
* {...}, * {...},
* ]) * ])
@ -71,11 +70,10 @@ export const ROUTER_PRIMARY_COMPONENT: OpaqueToken =
* ## Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm)) * ## Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))
* *
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; * import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
* *
* @Component({...}) * @Component({directives: [ROUTER_DIRECTIVES]})
* @View({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([ * @RouteConfig([
* {...}, * {...},
* ]) * ])
@ -94,15 +92,14 @@ export const ROUTER_DIRECTIVES: any[] = CONST_EXPR([RouterOutlet, RouterLink]);
* ## Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm)) * ## Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))
* *
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import { * import {
* ROUTER_DIRECTIVES, * ROUTER_DIRECTIVES,
* ROUTER_PROVIDERS, * ROUTER_PROVIDERS,
* RouteConfig * RouteConfig
* } from 'angular2/router'; * } from 'angular2/router';
* *
* @Component({...}) * @Component({directives: [ROUTER_DIRECTIVES]})
* @View({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([ * @RouteConfig([
* {...}, * {...},
* ]) * ])

View File

@ -138,9 +138,7 @@ export function platform(bindings?: Array<Type | Provider | any[]>): PlatformRef
* *
* ``` * ```
* @Component({ * @Component({
* selector: 'my-app' * selector: 'my-app',
* })
* @View({
* template: 'Hello {{ name }}!' * template: 'Hello {{ name }}!'
* }) * })
* class MyApp { * class MyApp {

View File

@ -12,7 +12,6 @@ export const APP_COMPONENT_REF_PROMISE = CONST_EXPR(new OpaqueToken('Promise<Com
* *
* ``` * ```
* @Component(...) * @Component(...)
* @View(...)
* class MyApp { * class MyApp {
* ... * ...
* } * }

View File

@ -10,8 +10,11 @@ export abstract class ChangeDetectorRef {
* ### Example ([live demo](http://plnkr.co/edit/GC512b?p=preview)) * ### Example ([live demo](http://plnkr.co/edit/GC512b?p=preview))
* *
* ```typescript * ```typescript
* @Component({selector: 'cmp', changeDetection: ChangeDetectionStrategy.OnPush}) * @Component({
* @View({template: `Number of ticks: {{numberOfTicks}}`}) * selector: 'cmp',
* changeDetection: ChangeDetectionStrategy.OnPush,
* template: `Number of ticks: {{numberOfTicks}}`
* })
* class Cmp { * class Cmp {
* numberOfTicks = 0; * numberOfTicks = 0;
* *
@ -26,9 +29,7 @@ export abstract class ChangeDetectorRef {
* *
* @Component({ * @Component({
* selector: 'app', * selector: 'app',
* changeDetection: ChangeDetectionStrategy.OnPush * changeDetection: ChangeDetectionStrategy.OnPush,
* })
* @View({
* template: ` * template: `
* <cmp><cmp> * <cmp><cmp>
* `, * `,
@ -69,8 +70,8 @@ export abstract class ChangeDetectorRef {
* } * }
* } * }
* *
* @Component({selector: 'giant-list'}) * @Component({
* @View({ * selector: 'giant-list',
* template: ` * template: `
* <li *ng-for="#d of dataProvider.data">Data {{d}}</lig> * <li *ng-for="#d of dataProvider.data">Data {{d}}</lig>
* `, * `,
@ -86,9 +87,8 @@ export abstract class ChangeDetectorRef {
* } * }
* *
* @Component({ * @Component({
* selector: 'app', providers: [DataProvider] * selector: 'app',
* }) * providers: [DataProvider],
* @View({
* template: ` * template: `
* <giant-list><giant-list> * <giant-list><giant-list>
* `, * `,
@ -151,8 +151,9 @@ export abstract class ChangeDetectorRef {
* } * }
* } * }
* *
* @Component({selector: 'live-data', inputs: ['live']}) * @Component({
* @View({ * selector: 'live-data',
* inputs: ['live'],
* template: `Data: {{dataProvider.data}}` * template: `Data: {{dataProvider.data}}`
* }) * })
* class LiveData { * class LiveData {
@ -168,9 +169,7 @@ export abstract class ChangeDetectorRef {
* *
* @Component({ * @Component({
* selector: 'app', * selector: 'app',
* providers: [DataProvider] * providers: [DataProvider],
* })
* @View({
* template: ` * template: `
* Live Update: <input type="checkbox" [(ng-model)]="live"> * Live Update: <input type="checkbox" [(ng-model)]="live">
* <live-data [live]="live"><live-data> * <live-data [live]="live"><live-data>

View File

@ -10,8 +10,8 @@ import {BaseException, WrappedException} from "angular2/src/core/facade/exceptio
* ### Example * ### Example
* *
* ```typescript * ```typescript
* @Component({selector: 'parent'}) * @Component({
* @View({ * selector: 'parent',
* template: ` * template: `
* <child [prop]="parentProp"></child> * <child [prop]="parentProp"></child>
* `, * `,
@ -55,9 +55,7 @@ export class ExpressionChangedAfterItHasBeenCheckedException extends BaseExcepti
* } * }
* *
* @Component({ * @Component({
* selector: 'app' * selector: 'app',
* })
* @View({
* template: ` * template: `
* <child [prop]="field.first"></child> * <child [prop]="field.first"></child>
* `, * `,

View File

@ -212,9 +212,7 @@ export class SkipSelfMetadata {
* *
* @Component({ * @Component({
* selector: 'parent-cmp', * selector: 'parent-cmp',
* providers: [HostService] * providers: [HostService],
* })
* @View({
* template: ` * template: `
* Dir: <child-directive></child-directive> * Dir: <child-directive></child-directive>
* `, * `,
@ -225,9 +223,7 @@ export class SkipSelfMetadata {
* *
* @Component({ * @Component({
* selector: 'app', * selector: 'app',
* providers: [OtherService] * providers: [OtherService],
* })
* @View({
* template: ` * template: `
* Parent: <parent-cmp></parent-cmp> * Parent: <parent-cmp></parent-cmp>
* `, * `,

View File

@ -34,9 +34,7 @@ export * from './directives/observable_list_diff';
* import {OtherDirective} from './myDirectives'; * import {OtherDirective} from './myDirectives';
* *
* @Component({ * @Component({
* selector: 'my-component' * selector: 'my-component',
* })
* @View({
* templateUrl: 'myComponent.html', * templateUrl: 'myComponent.html',
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective] * directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* }) * })
@ -51,9 +49,7 @@ export * from './directives/observable_list_diff';
* import {OtherDirective} from './myDirectives'; * import {OtherDirective} from './myDirectives';
* *
* @Component({ * @Component({
* selector: 'my-component' * selector: 'my-component',
* })
* @View({
* templateUrl: 'myComponent.html', * templateUrl: 'myComponent.html',
* directives: [CORE_DIRECTIVES, OtherDirective] * directives: [CORE_DIRECTIVES, OtherDirective]
* }) * })

View File

@ -30,13 +30,11 @@ import {StringMapWrapper, isListLikeIterable} from 'angular2/src/core/facade/col
* ### Example ([live demo](http://plnkr.co/edit/a4YdtmWywhJ33uqfpPPn?p=preview)): * ### Example ([live demo](http://plnkr.co/edit/a4YdtmWywhJ33uqfpPPn?p=preview)):
* *
* ``` * ```
* import {Component, View, NgClass} from 'angular2/angular2'; * import {Component, NgClass} from 'angular2/angular2';
* *
* @Component({ * @Component({
* selector: 'toggle-button', * selector: 'toggle-button',
* inputs: ['isDisabled'] * inputs: ['isDisabled'],
* })
* @View({
* template: ` * template: `
* <div class="button" [ng-class]="{active: isOn, disabled: isDisabled}" * <div class="button" [ng-class]="{active: isOn, disabled: isDisabled}"
* (click)="toggle(!isOn)"> * (click)="toggle(!isOn)">

View File

@ -23,12 +23,10 @@ import {isPresent, isBlank, print} from 'angular2/src/core/facade/lang';
* ### Example ([live demo](http://plnkr.co/edit/YamGS6GkUh9GqWNQhCyM?p=preview)): * ### Example ([live demo](http://plnkr.co/edit/YamGS6GkUh9GqWNQhCyM?p=preview)):
* *
* ``` * ```
* import {Component, View, NgStyle} from 'angular2/angular2'; * import {Component, NgStyle} from 'angular2/angular2';
* *
* @Component({ * @Component({
* selector: 'ng-style-example' * selector: 'ng-style-example',
* })
* @View({
* template: ` * template: `
* <h1 [ng-style]="{'font-style': style, 'font-size': size, 'font-weight': weight}"> * <h1 [ng-style]="{'font-style': style, 'font-size': size, 'font-weight': weight}">
* Change style of this text! * Change style of this text!

View File

@ -104,8 +104,9 @@ export class Observable {
* title gets clicked: * title gets clicked:
* *
* ``` * ```
* @Component({selector: 'zippy'}) * @Component({
* @View({template: ` * selector: 'zippy',
* template: `
* <div class="zippy"> * <div class="zippy">
* <div (click)="toggle()">Toggle</div> * <div (click)="toggle()">Toggle</div>
* <div [hidden]="!visible"> * <div [hidden]="!visible">

View File

@ -40,11 +40,9 @@ export {NgControlStatus} from './directives/ng_control_status';
* ### Example: * ### Example:
* *
* ```typescript * ```typescript
* @View({
* directives: [FORM_DIRECTIVES]
* })
* @Component({ * @Component({
* selector: 'my-app' * selector: 'my-app',
* directives: [FORM_DIRECTIVES]
* }) * })
* class MyApp {} * class MyApp {}
* ``` * ```

View File

@ -23,8 +23,8 @@ const controlGroupBinding =
* We can work with each group separately: check its validity, get its value, listen to its changes. * We can work with each group separately: check its validity, get its value, listen to its changes.
* *
* ``` * ```
* @Component({selector: "signup-comp"}) * @Component({
* @View({ * selector: "signup-comp",
* directives: [FORM_DIRECTIVES], * directives: [FORM_DIRECTIVES],
* template: ` * template: `
* <form #f="form" (submit)='onSignUp(f.value)'> * <form #f="form" (submit)='onSignUp(f.value)'>

View File

@ -28,8 +28,8 @@ const controlNameBinding =
* changes. * changes.
* *
* ``` * ```
* @Component({selector: "login-comp"}) * @Component({
* @View({ * selector: "login-comp",
* directives: [FORM_DIRECTIVES], * directives: [FORM_DIRECTIVES],
* template: ` * template: `
* <form #f="form" (submit)='onLogIn(f.value)'> * <form #f="form" (submit)='onLogIn(f.value)'>
@ -50,8 +50,8 @@ const controlNameBinding =
* We can also use ng-model to bind a domain model to the form. * We can also use ng-model to bind a domain model to the form.
* *
* ``` * ```
* @Component({selector: "login-comp"}) * @Component({
* @View({ * selector: "login-comp",
* directives: [FORM_DIRECTIVES], * directives: [FORM_DIRECTIVES],
* template: ` * template: `
* <form (submit)='onLogIn()'> * <form (submit)='onLogIn()'>

View File

@ -42,9 +42,7 @@ const formDirectiveProvider =
* *
* ```typescript * ```typescript
* @Component({ * @Component({
* selector: 'my-app' * selector: 'my-app',
* })
* @View({
* template: ` * template: `
* <div> * <div>
* <p>Submit the form to see the data object Angular builds</p> * <p>Submit the form to see the data object Angular builds</p>

View File

@ -24,9 +24,7 @@ const formControlBinding =
* *
* ```typescript * ```typescript
* @Component({ * @Component({
* selector: 'my-app' * selector: 'my-app',
* })
* @View({
* template: ` * template: `
* <div> * <div>
* <h2>NgFormControl Example</h2> * <h2>NgFormControl Example</h2>
@ -51,8 +49,8 @@ const formControlBinding =
* ### Example ([live demo](http://plnkr.co/edit/yHMLuHO7DNgT8XvtjTDH?p=preview)) * ### Example ([live demo](http://plnkr.co/edit/yHMLuHO7DNgT8XvtjTDH?p=preview))
* *
* ```typescript * ```typescript
* @Component({selector: "login-comp"}) * @Component({
* @View({ * selector: "login-comp",
* directives: [FORM_DIRECTIVES], * directives: [FORM_DIRECTIVES],
* template: "<input type='text' [ng-form-control]='loginControl' [(ng-model)]='login'>" * template: "<input type='text' [ng-form-control]='loginControl' [(ng-model)]='login'>"
* }) * })

View File

@ -25,9 +25,7 @@ const formDirectiveProvider =
* *
* ```typescript * ```typescript
* @Component({ * @Component({
* selector: 'my-app' * selector: 'my-app',
* })
* @View({
* template: ` * template: `
* <div> * <div>
* <h2>NgFormModel Example</h2> * <h2>NgFormModel Example</h2>
@ -60,8 +58,8 @@ const formDirectiveProvider =
* We can also use ng-model to bind a domain model to the form. * We can also use ng-model to bind a domain model to the form.
* *
* ```typescript * ```typescript
* @Component({selector: "login-comp"}) * @Component({
* @View({ * selector: "login-comp",
* directives: [FORM_DIRECTIVES], * directives: [FORM_DIRECTIVES],
* template: ` * template: `
* <form [ng-form-model]='loginForm'> * <form [ng-form-model]='loginForm'>

View File

@ -24,8 +24,8 @@ const formControlBinding =
* *
* ### Example ([live demo](http://plnkr.co/edit/R3UX5qDaUqFO2VYR0UzH?p=preview)) * ### Example ([live demo](http://plnkr.co/edit/R3UX5qDaUqFO2VYR0UzH?p=preview))
* ```typescript * ```typescript
* @Component({selector: "search-comp"}) * @Component({
* @View({ * selector: "search-comp",
* directives: [FORM_DIRECTIVES], * directives: [FORM_DIRECTIVES],
* template: `<input type='text' [(ng-model)]="searchQuery">` * template: `<input type='text' [(ng-model)]="searchQuery">`
* }) * })

View File

@ -10,14 +10,12 @@ import * as modelModule from './model';
* # Example * # Example
* *
* ``` * ```
* import {Component, View, bootstrap} from 'angular2/angular2'; * import {Component, bootstrap} from 'angular2/angular2';
* import {FormBuilder, Validators, FORM_DIRECTIVES, ControlGroup} from 'angular2/core'; * import {FormBuilder, Validators, FORM_DIRECTIVES, ControlGroup} from 'angular2/core';
* *
* @Component({ * @Component({
* selector: 'login-comp', * selector: 'login-comp',
* viewProviders: [FormBuilder] * viewProviders: [FormBuilder],
* })
* @View({
* template: ` * template: `
* <form [control-group]="loginForm"> * <form [control-group]="loginForm">
* Login <input control="login"> * Login <input control="login">

View File

@ -50,8 +50,10 @@ export var LIFECYCLE_HOOKS_VALUES = [
* ### Example ([live example](http://plnkr.co/edit/AHrB6opLqHDBPkt4KpdT?p=preview)): * ### Example ([live example](http://plnkr.co/edit/AHrB6opLqHDBPkt4KpdT?p=preview)):
* *
* ```typescript * ```typescript
* @Component({selector: 'my-cmp'}) * @Component({
* @View({template: `<p>myProp = {{myProp}}</p>`}) * selector: 'my-cmp',
* template: `<p>myProp = {{myProp}}</p>`
* })
* class MyComponent implements OnChanges { * class MyComponent implements OnChanges {
* @Input() myProp: any; * @Input() myProp: any;
* *
@ -60,8 +62,8 @@ export var LIFECYCLE_HOOKS_VALUES = [
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <button (click)="value = value + 1">Change MyComponent</button> * <button (click)="value = value + 1">Change MyComponent</button>
* <my-cmp [my-prop]="value"></my-cmp>`, * <my-cmp [my-prop]="value"></my-cmp>`,
@ -87,8 +89,10 @@ export interface OnChanges { onChanges(changes: {[key: string]: SimpleChange});
* ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview)) * ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview))
* *
* ```typescript * ```typescript
* @Component({selector: 'my-cmp'}) * @Component({
* @View({template: `<p>my-component</p>`}) * selector: 'my-cmp',
* template: `<p>my-component</p>`
* })
* class MyComponent implements OnInit, OnDestroy { * class MyComponent implements OnInit, OnDestroy {
* onInit() { * onInit() {
* console.log('onInit'); * console.log('onInit');
@ -99,8 +103,8 @@ export interface OnChanges { onChanges(changes: {[key: string]: SimpleChange});
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <button (click)="hasChild = !hasChild"> * <button (click)="hasChild = !hasChild">
* {{hasChild ? 'Destroy' : 'Create'}} MyComponent * {{hasChild ? 'Destroy' : 'Create'}} MyComponent
@ -141,8 +145,8 @@ export interface OnInit { onInit(); }
* array `list`: * array `list`:
* *
* ```typescript * ```typescript
* @Component({selector: 'custom-check'}) * @Component({
* @View({ * selector: 'custom-check',
* template: ` * template: `
* <p>Changes:</p> * <p>Changes:</p>
* <ul> * <ul>
@ -169,8 +173,8 @@ export interface OnInit { onInit(); }
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <button (click)="list.push(list.length)">Push</button> * <button (click)="list.push(list.length)">Push</button>
* <button (click)="list.pop()">Pop</button> * <button (click)="list.pop()">Pop</button>
@ -193,8 +197,10 @@ export interface DoCheck { doCheck(); }
* ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview)) * ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview))
* *
* ```typesript * ```typesript
* @Component({selector: 'my-cmp'}) * @Component({
* @View({template: `<p>my-component</p>`}) * selector: 'my-cmp',
* template: `<p>my-component</p>`
* })
* class MyComponent implements OnInit, OnDestroy { * class MyComponent implements OnInit, OnDestroy {
* onInit() { * onInit() {
* console.log('onInit'); * console.log('onInit');
@ -205,8 +211,8 @@ export interface DoCheck { doCheck(); }
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <button (click)="hasChild = !hasChild"> * <button (click)="hasChild = !hasChild">
* {{hasChild ? 'Destroy' : 'Create'}} MyComponent * {{hasChild ? 'Destroy' : 'Create'}} MyComponent
@ -230,14 +236,18 @@ export interface OnDestroy { onDestroy(); }
* ### Example ([live demo](http://plnkr.co/edit/plamXUpsLQbIXpViZhUO?p=preview)) * ### Example ([live demo](http://plnkr.co/edit/plamXUpsLQbIXpViZhUO?p=preview))
* *
* ```typescript * ```typescript
* @Component({selector: 'child-cmp'}) * @Component({
* @View({template: `{{where}} child`}) * selector: 'child-cmp',
* template: `{{where}} child`
* })
* class ChildComponent { * class ChildComponent {
* @Input() where: string; * @Input() where: string;
* } * }
* *
* @Component({selector: 'parent-cmp'}) * @Component({
* @View({template: `<ng-content></ng-content>`}) * selector: 'parent-cmp',
* template: `<ng-content></ng-content>`
* })
* class ParentComponent implements AfterContentInit { * class ParentComponent implements AfterContentInit {
* @ContentChild(ChildComponent) contentChild: ChildComponent; * @ContentChild(ChildComponent) contentChild: ChildComponent;
* *
@ -256,8 +266,8 @@ export interface OnDestroy { onDestroy(); }
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <parent-cmp> * <parent-cmp>
* <child-cmp where="content"></child-cmp> * <child-cmp where="content"></child-cmp>
@ -278,14 +288,12 @@ export interface AfterContentInit { afterContentInit(); }
* ### Example ([live demo](http://plnkr.co/edit/tGdrytNEKQnecIPkD7NU?p=preview)) * ### Example ([live demo](http://plnkr.co/edit/tGdrytNEKQnecIPkD7NU?p=preview))
* *
* ```typescript * ```typescript
* @Component({selector: 'child-cmp'}) * @Component({selector: 'child-cmp', template: `{{where}} child`})
* @View({template: `{{where}} child`})
* class ChildComponent { * class ChildComponent {
* @Input() where: string; * @Input() where: string;
* } * }
* *
* @Component({selector: 'parent-cmp'}) * @Component({selector: 'parent-cmp', template: `<ng-content></ng-content>`})
* @View({template: `<ng-content></ng-content>`})
* class ParentComponent implements AfterContentChecked { * class ParentComponent implements AfterContentChecked {
* @ContentChild(ChildComponent) contentChild: ChildComponent; * @ContentChild(ChildComponent) contentChild: ChildComponent;
* *
@ -304,8 +312,8 @@ export interface AfterContentInit { afterContentInit(); }
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <parent-cmp> * <parent-cmp>
* <button (click)="hasContent = !hasContent">Toggle content child</button> * <button (click)="hasContent = !hasContent">Toggle content child</button>
@ -328,14 +336,13 @@ export interface AfterContentChecked { afterContentChecked(); }
* ### Example ([live demo](http://plnkr.co/edit/LhTKVMEM0fkJgyp4CI1W?p=preview)) * ### Example ([live demo](http://plnkr.co/edit/LhTKVMEM0fkJgyp4CI1W?p=preview))
* *
* ```typescript * ```typescript
* @Component({selector: 'child-cmp'}) * @Component({selector: 'child-cmp', template: `{{where}} child`})
* @View({template: `{{where}} child`})
* class ChildComponent { * class ChildComponent {
* @Input() where: string; * @Input() where: string;
* } * }
* *
* @Component({selector: 'parent-cmp'}) * @Component({
* @View({ * selector: 'parent-cmp',
* template: `<child-cmp where="view"></child-cmp>`, * template: `<child-cmp where="view"></child-cmp>`,
* directives: [ChildComponent] * directives: [ChildComponent]
* }) * })
@ -357,8 +364,8 @@ export interface AfterContentChecked { afterContentChecked(); }
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: `<parent-cmp></parent-cmp>`, * template: `<parent-cmp></parent-cmp>`,
* directives: [ParentComponent] * directives: [ParentComponent]
* }) * })
@ -376,14 +383,13 @@ export interface AfterViewInit { afterViewInit(); }
* ### Example ([live demo](http://plnkr.co/edit/0qDGHcPQkc25CXhTNzKU?p=preview)) * ### Example ([live demo](http://plnkr.co/edit/0qDGHcPQkc25CXhTNzKU?p=preview))
* *
* ```typescript * ```typescript
* @Component({selector: 'child-cmp'}) * @Component({selector: 'child-cmp', template: `{{where}} child`})
* @View({template: `{{where}} child`})
* class ChildComponent { * class ChildComponent {
* @Input() where: string; * @Input() where: string;
* } * }
* *
* @Component({selector: 'parent-cmp'}) * @Component({
* @View({ * selector: 'parent-cmp',
* template: ` * template: `
* <button (click)="showView = !showView">Toggle view child</button> * <button (click)="showView = !showView">Toggle view child</button>
* <child-cmp *ng-if="showView" where="view"></child-cmp>`, * <child-cmp *ng-if="showView" where="view"></child-cmp>`,
@ -408,8 +414,8 @@ export interface AfterViewInit { afterViewInit(); }
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: `<parent-cmp></parent-cmp>`, * template: `<parent-cmp></parent-cmp>`,
* directives: [ParentComponent] * directives: [ParentComponent]
* }) * })

View File

@ -179,10 +179,9 @@ export interface DirectiveFactory {
* ## Example as TypeScript Decorator * ## Example as TypeScript Decorator
* *
* ``` * ```
* import {Component, View} from "angular2/angular2"; * import {Component} from "angular2/angular2";
* *
* @Component({...}) * @Component({...})
* @View({...})
* class MyComponent { * class MyComponent {
* constructor() { * constructor() {
* ... * ...
@ -195,7 +194,6 @@ export interface DirectiveFactory {
* ``` * ```
* var MyComponent = ng * var MyComponent = ng
* .Component({...}) * .Component({...})
* .View({...})
* .Class({ * .Class({
* constructor: function() { * constructor: function() {
* ... * ...
@ -211,8 +209,7 @@ export interface DirectiveFactory {
* }; * };
* *
* MyComponent.annotations = [ * MyComponent.annotations = [
* new ng.Component({...}), * new ng.Component({...})
* new ng.View({...})
* ] * ]
* ``` * ```
*/ */
@ -338,10 +335,9 @@ export interface ViewFactory {
* ## Example as TypeScript Decorator * ## Example as TypeScript Decorator
* *
* ``` * ```
* import {Attribute, Component, View} from "angular2/angular2"; * import {Attribute, Component} from "angular2/angular2";
* *
* @Component({...}) * @Component({...})
* @View({...})
* class MyComponent { * class MyComponent {
* constructor(@Attribute('title') title: string) { * constructor(@Attribute('title') title: string) {
* ... * ...
@ -354,7 +350,6 @@ export interface ViewFactory {
* ``` * ```
* var MyComponent = ng * var MyComponent = ng
* .Component({...}) * .Component({...})
* .View({...})
* .Class({ * .Class({
* constructor: [new ng.Attribute('title'), function(title) { * constructor: [new ng.Attribute('title'), function(title) {
* ... * ...
@ -370,8 +365,7 @@ export interface ViewFactory {
* }; * };
* *
* MyComponent.annotations = [ * MyComponent.annotations = [
* new ng.Component({...}), * new ng.Component({...})
* new ng.View({...})
* ] * ]
* MyComponent.parameters = [ * MyComponent.parameters = [
* [new ng.Attribute('title')] * [new ng.Attribute('title')]
@ -389,10 +383,9 @@ export interface AttributeFactory {
* ### Example as TypeScript Decorator * ### Example as TypeScript Decorator
* *
* ``` * ```
* import {Query, QueryList, Component, View} from "angular2/angular2"; * import {Query, QueryList, Component} from "angular2/angular2";
* *
* @Component({...}) * @Component({...})
* @View({...})
* class MyComponent { * class MyComponent {
* constructor(@Query(SomeType) queryList: QueryList<SomeType>) { * constructor(@Query(SomeType) queryList: QueryList<SomeType>) {
* ... * ...
@ -405,7 +398,6 @@ export interface AttributeFactory {
* ``` * ```
* var MyComponent = ng * var MyComponent = ng
* .Component({...}) * .Component({...})
* .View({...})
* .Class({ * .Class({
* constructor: [new ng.Query(SomeType), function(queryList) { * constructor: [new ng.Query(SomeType), function(queryList) {
* ... * ...
@ -421,8 +413,7 @@ export interface AttributeFactory {
* }; * };
* *
* MyComponent.annotations = [ * MyComponent.annotations = [
* new ng.Component({...}), * new ng.Component({...})
* new ng.View({...})
* ] * ]
* MyComponent.parameters = [ * MyComponent.parameters = [
* [new ng.Query(SomeType)] * [new ng.Query(SomeType)]

View File

@ -73,15 +73,12 @@ export class AttributeMetadata extends DependencyMetadata {
* selector: 'pane', * selector: 'pane',
* inputs: ['title'] * inputs: ['title']
* }) * })
* @View(...)
* class Pane { * class Pane {
* title:string; * title:string;
* } * }
* *
* @Component({ * @Component({
* selector: 'tabs' * selector: 'tabs',
* })
* @View({
* template: ` * template: `
* <ul> * <ul>
* <li *ng-for="#pane of panes">{{pane.title}}</li> * <li *ng-for="#pane of panes">{{pane.title}}</li>
@ -105,10 +102,7 @@ export class AttributeMetadata extends DependencyMetadata {
* <div #findme>...</div> * <div #findme>...</div>
* </seeker> * </seeker>
* *
* @Component({ * @Component({ selector: 'foo' })
* selector: 'foo'
* })
* @View(...)
* class seeker { * class seeker {
* constructor(@Query('findme') elList: QueryList<ElementRef>) {...} * constructor(@Query('findme') elList: QueryList<ElementRef>) {...}
* } * }
@ -128,7 +122,6 @@ export class AttributeMetadata extends DependencyMetadata {
* @Component({ * @Component({
* selector: 'foo' * selector: 'foo'
* }) * })
* @View(...)
* class Seeker { * class Seeker {
* constructor(@Query('findMe, findMeToo') elList: QueryList<ElementRef>) {...} * constructor(@Query('findMe, findMeToo') elList: QueryList<ElementRef>) {...}
* } * }
@ -316,9 +309,10 @@ export class ViewQueryMetadata extends QueryMetadata {
* *
* ``` * ```
* @Component({ * @Component({
* selector: 'someDir' * selector: 'someDir',
* templateUrl: 'someTemplate',
* directives: [ItemDirective]
* }) * })
* @View({templateUrl: 'someTemplate', directives: [ItemDirective]})
* class SomeDir { * class SomeDir {
* @ViewChildren(ItemDirective) viewChildren: QueryList<ItemDirective>; * @ViewChildren(ItemDirective) viewChildren: QueryList<ItemDirective>;
* *
@ -342,9 +336,10 @@ export class ViewChildrenMetadata extends ViewQueryMetadata {
* *
* ``` * ```
* @Component({ * @Component({
* selector: 'someDir' * selector: 'someDir',
* templateUrl: 'someTemplate',
* directives: [ItemDirective]
* }) * })
* @View({templateUrl: 'someTemplate', directives: [ItemDirective]})
* class SomeDir { * class SomeDir {
* @ViewChild(ItemDirective) viewChild:ItemDirective; * @ViewChild(ItemDirective) viewChild:ItemDirective;
* *

View File

@ -437,9 +437,7 @@ export class DirectiveMetadata extends InjectableMetadata {
* ```typescript * ```typescript
* @Component({ * @Component({
* selector: 'bank-account', * selector: 'bank-account',
* inputs: ['bankName', 'id: account-id'] * inputs: ['bankName', 'id: account-id'],
* })
* @View({
* template: ` * template: `
* Bank Name: {{bankName}} * Bank Name: {{bankName}}
* Account Id: {{id}} * Account Id: {{id}}
@ -453,8 +451,8 @@ export class DirectiveMetadata extends InjectableMetadata {
* normalizedBankName: string; * normalizedBankName: string;
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <bank-account bank-name="RBC" account-id="4747"></bank-account> * <bank-account bank-name="RBC" account-id="4747"></bank-account>
* `, * `,
@ -503,8 +501,8 @@ export class DirectiveMetadata extends InjectableMetadata {
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <interval-dir (every-second)="everySecond()" (every-five-seconds)="everyFiveSeconds()"> * <interval-dir (every-second)="everySecond()" (every-five-seconds)="everyFiveSeconds()">
* </interval-dir> * </interval-dir>
@ -564,8 +562,8 @@ export class DirectiveMetadata extends InjectableMetadata {
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: `<button counting>Increment</button>`, * template: `<button counting>Increment</button>`,
* directives: [CountClicks] * directives: [CountClicks]
* }) * })
@ -600,8 +598,8 @@ export class DirectiveMetadata extends InjectableMetadata {
* get invalid { return this.control.invalid; } * get invalid { return this.control.invalid; }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: `<input [(ng-model)]="prop">`, * template: `<input [(ng-model)]="prop">`,
* directives: [FORM_DIRECTIVES, NgModelStatus] * directives: [FORM_DIRECTIVES, NgModelStatus]
* }) * })
@ -688,8 +686,6 @@ export class DirectiveMetadata extends InjectableMetadata {
* *
* @Component({ * @Component({
* selector: 'main', * selector: 'main',
* })
* @View({
* template: `<child-dir #c="child"></child-dir>`, * template: `<child-dir #c="child"></child-dir>`,
* directives: [ChildDir] * directives: [ChildDir]
* }) * })
@ -735,9 +731,7 @@ export class DirectiveMetadata extends InjectableMetadata {
* queries: { * queries: {
* contentChildren: new ContentChildren(ChildDirective), * contentChildren: new ContentChildren(ChildDirective),
* viewChildren: new ViewChildren(ChildDirective) * viewChildren: new ViewChildren(ChildDirective)
* } * },
* })
* @View({
* template: '<child-directive></child-directive>', * template: '<child-directive></child-directive>',
* directives: [ChildDirective] * directives: [ChildDirective]
* }) * })
@ -812,9 +806,7 @@ export class DirectiveMetadata extends InjectableMetadata {
* *
* ``` * ```
* @Component({ * @Component({
* selector: 'greet' * selector: 'greet',
* })
* @View({
* template: 'Hello {{name}}!' * template: 'Hello {{name}}!'
* }) * })
* class Greet { * class Greet {
@ -869,9 +861,7 @@ export class ComponentMetadata extends DirectiveMetadata {
* selector: 'greet', * selector: 'greet',
* viewProviders: [ * viewProviders: [
* Greeter * Greeter
* ] * ],
* })
* @View({
* template: `<needs-greeter></needs-greeter>`, * template: `<needs-greeter></needs-greeter>`,
* directives: [NeedsGreeter] * directives: [NeedsGreeter]
* }) * })
@ -998,8 +988,8 @@ export class PipeMetadata extends InjectableMetadata {
* The following example creates a component with two input properties. * The following example creates a component with two input properties.
* *
* ```typescript * ```typescript
* @Component({selector: 'bank-account'}) * @Component({
* @View({ * selector: 'bank-account',
* template: ` * template: `
* Bank Name: {{bankName}} * Bank Name: {{bankName}}
* Account Id: {{id}} * Account Id: {{id}}
@ -1013,8 +1003,8 @@ export class PipeMetadata extends InjectableMetadata {
* normalizedBankName: string; * normalizedBankName: string;
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <bank-account bank-name="RBC" account-id="4747"></bank-account> * <bank-account bank-name="RBC" account-id="4747"></bank-account>
* `, * `,
@ -1060,8 +1050,8 @@ export class InputMetadata {
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: ` * template: `
* <interval-dir (every-second)="everySecond()" (every-five-seconds)="everyFiveSeconds()"> * <interval-dir (every-second)="everySecond()" (every-five-seconds)="everyFiveSeconds()">
* </interval-dir> * </interval-dir>
@ -1103,8 +1093,8 @@ export class OutputMetadata {
* @HostBinding('[class.invalid]') get invalid { return this.control.invalid; } * @HostBinding('[class.invalid]') get invalid { return this.control.invalid; }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: `<input [(ng-model)]="prop">`, * template: `<input [(ng-model)]="prop">`,
* directives: [FORM_DIRECTIVES, NgModelStatus] * directives: [FORM_DIRECTIVES, NgModelStatus]
* }) * })
@ -1144,8 +1134,8 @@ export class HostBindingMetadata {
* } * }
* } * }
* *
* @Component({selector: 'app'}) * @Component({
* @View({ * selector: 'app',
* template: `<button counting>Increment</button>`, * template: `<button counting>Increment</button>`,
* directives: [CountClicks] * directives: [CountClicks]
* }) * })

View File

@ -48,9 +48,7 @@ export var VIEW_ENCAPSULATION_VALUES =
* *
* ``` * ```
* @Component({ * @Component({
* selector: 'greet' * selector: 'greet',
* })
* @View({
* template: 'Hello {{name}}!', * template: 'Hello {{name}}!',
* directives: [GreetUser, Bold] * directives: [GreetUser, Bold]
* }) * })
@ -102,9 +100,7 @@ export class ViewMetadata {
* *
* ```javascript * ```javascript
* @Component({ * @Component({
* selector: 'my-component' * selector: 'my-component',
* })
* @View({
* directives: [NgFor] * directives: [NgFor]
* template: ' * template: '
* <ul> * <ul>

View File

@ -47,9 +47,7 @@ var _observableStrategy = new ObservableStrategy();
* ``` * ```
* import {Observable} from 'angular2/core'; * import {Observable} from 'angular2/core';
* @Component({ * @Component({
* selector: "task-cmp" * selector: "task-cmp",
* })
* @View({
* template: "Time: {{ time | async }}" * template: "Time: {{ time | async }}"
* }) * })
* class Task { * class Task {

View File

@ -12,9 +12,7 @@ import {Pipe} from 'angular2/src/core/metadata';
* *
* ``` * ```
* @Component({ * @Component({
* selector: "user-cmp" * selector: "user-cmp",
* })
* @View({
* template: "User: {{ user | json }}" * template: "User: {{ user | json }}"
* }) * })
* class Username { * class Username {

View File

@ -14,9 +14,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
* *
* ``` * ```
* @Component({ * @Component({
* selector: "username-cmp" * selector: "username-cmp",
* })
* @View({
* template: "Username: {{ user | lowercase }}" * template: "Username: {{ user | lowercase }}"
* }) * })
* class Username { * class Username {

View File

@ -13,9 +13,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
* *
* ``` * ```
* @Component({ * @Component({
* selector: "username-cmp" * selector: "username-cmp",
* })
* @View({
* template: "Username: {{ user | uppercase }}" * template: "Username: {{ user | uppercase }}"
* }) * })
* class Username { * class Username {

View File

@ -26,9 +26,7 @@ export interface NgZoneZone extends Zone {
* import {Component, View, NgIf, NgZone} from 'angular2/angular2'; * import {Component, View, NgIf, NgZone} from 'angular2/angular2';
* *
* @Component({ * @Component({
* selector: 'ng-zone-demo' * selector: 'ng-zone-demo'.
* })
* @View({
* template: ` * template: `
* <h2>Demo: NgZone</h2> * <h2>Demo: NgZone</h2>
* *

View File

@ -40,8 +40,11 @@ function mergeOptions(defaultOpts, providedOpts, method, url): RequestOptions {
* *
* ```typescript * ```typescript
* import {Http, HTTP_PROVIDERS} from 'angular2/http'; * import {Http, HTTP_PROVIDERS} from 'angular2/http';
* @Component({selector: 'http-app', viewProviders: [HTTP_PROVIDERS]}) * @Component({
* @View({templateUrl: 'people.html'}) * selector: 'http-app',
* viewProviders: [HTTP_PROVIDERS],
* templateUrl: 'people.html'
* })
* class PeopleComponent { * class PeopleComponent {
* constructor(http: Http) { * constructor(http: Http) {
* http.get('people.json') * http.get('people.json')

View File

@ -23,8 +23,7 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser
* Location * Location
* } from 'angular2/router'; * } from 'angular2/router';
* *
* @Component({...}) * @Component({directives: [ROUTER_DIRECTIVES]})
* @View({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([ * @RouteConfig([
* {...}, * {...},
* ]) * ])

View File

@ -15,18 +15,16 @@ import {Url} from './url_parser';
* ## Example * ## Example
* *
* ``` * ```
* import {bootstrap, Component, View} from 'angular2/angular2'; * import {bootstrap, Component} from 'angular2/angular2';
* import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; * import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
* *
* @Component({...}) * @Component({directives: [ROUTER_DIRECTIVES]})
* @View({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([ * @RouteConfig([
* {path: '/user/:id', component: UserCmp, as: 'UserCmp'}, * {path: '/user/:id', component: UserCmp, as: 'UserCmp'},
* ]) * ])
* class AppCmp {} * class AppCmp {}
* *
* @Component({...}) * @Component({ template: 'user: {{id}}' })
* @View({ template: 'user: {{id}}' })
* class UserCmp { * class UserCmp {
* string: id; * string: id;
* constructor(params: RouteParams) { * constructor(params: RouteParams) {
@ -53,11 +51,10 @@ export class RouteParams {
* ## Example * ## Example
* *
* ``` * ```
* import {bootstrap, Component, View} from 'angular2/angular2'; * import {bootstrap, Component} from 'angular2/angular2';
* import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; * import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
* *
* @Component({...}) * @Component({directives: [ROUTER_DIRECTIVES]})
* @View({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([ * @RouteConfig([
* {...}, * {...},
* ]) * ])

View File

@ -23,13 +23,11 @@ var __ignore_me = global;
* *
* ## Example * ## Example
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import {OnActivate, ComponentInstruction} from 'angular2/router'; * import {OnActivate, ComponentInstruction} from 'angular2/router';
* *
* @Component({ * @Component({
* selector: 'my-cmp' * selector: 'my-cmp',
* })
* @View({
* template: '<div>hello!</div>' * template: '<div>hello!</div>'
* }) * })
* class MyCmp implements OnActivate { * class MyCmp implements OnActivate {
@ -56,13 +54,11 @@ export interface OnActivate {
* *
* ## Example * ## Example
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import {CanReuse, OnReuse, ComponentInstruction} from 'angular2/router'; * import {CanReuse, OnReuse, ComponentInstruction} from 'angular2/router';
* *
* @Component({ * @Component({
* selector: 'my-cmp' * selector: 'my-cmp',
* })
* @View({
* template: '<div>hello!</div>' * template: '<div>hello!</div>'
* }) * })
* class MyCmp implements CanReuse, OnReuse { * class MyCmp implements CanReuse, OnReuse {
@ -92,13 +88,11 @@ export interface OnReuse {
* *
* ## Example * ## Example
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import {OnDeactivate, ComponentInstruction} from 'angular2/router'; * import {OnDeactivate, ComponentInstruction} from 'angular2/router';
* *
* @Component({ * @Component({
* selector: 'my-cmp' * selector: 'my-cmp',
* })
* @View({
* template: '<div>hello!</div>' * template: '<div>hello!</div>'
* }) * })
* class MyCmp implements OnDeactivate { * class MyCmp implements OnDeactivate {
@ -129,13 +123,11 @@ export interface OnDeactivate {
* *
* ## Example * ## Example
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import {CanReuse, OnReuse, ComponentInstruction} from 'angular2/router'; * import {CanReuse, OnReuse, ComponentInstruction} from 'angular2/router';
* *
* @Component({ * @Component({
* selector: 'my-cmp' * selector: 'my-cmp',
* })
* @View({
* template: '<div>hello!</div>' * template: '<div>hello!</div>'
* }) * })
* class MyCmp implements CanReuse, OnReuse { * class MyCmp implements CanReuse, OnReuse {
@ -169,13 +161,11 @@ export interface CanReuse {
* *
* ## Example * ## Example
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import {CanDeactivate, ComponentInstruction} from 'angular2/router'; * import {CanDeactivate, ComponentInstruction} from 'angular2/router';
* *
* @Component({ * @Component({
* selector: 'my-cmp' * selector: 'my-cmp',
* })
* @View({
* template: '<div>hello!</div>' * template: '<div>hello!</div>'
* }) * })
* class MyCmp implements CanDeactivate { * class MyCmp implements CanDeactivate {

View File

@ -39,9 +39,7 @@ export {
* import {CanActivate} from 'angular2/router'; * import {CanActivate} from 'angular2/router';
* *
* @Component({ * @Component({
* selector: 'control-panel-cmp' * selector: 'control-panel-cmp',
* })
* @View({
* template: '<div>Control Panel: ...</div>' * template: '<div>Control Panel: ...</div>'
* }) * })
* @CanActivate(() => checkIfUserIsLoggedIn()) * @CanActivate(() => checkIfUserIsLoggedIn())

View File

@ -16,11 +16,10 @@ import {OpaqueToken, Injectable, Optional, Inject} from 'angular2/src/core/di';
* ## Example * ## Example
* *
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; * import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
* *
* @Component({...}) * @Component({directives: [ROUTER_DIRECTIVES]})
* @View({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([ * @RouteConfig([
* {...}, * {...},
* ]) * ])
@ -56,7 +55,7 @@ export const APP_BASE_HREF: OpaqueToken = CONST_EXPR(new OpaqueToken('appBaseHre
* ## Example * ## Example
* *
* ``` * ```
* import {Component, View} from 'angular2/angular2'; * import {Component} from 'angular2/angular2';
* import { * import {
* ROUTER_DIRECTIVES, * ROUTER_DIRECTIVES,
* ROUTER_PROVIDERS, * ROUTER_PROVIDERS,
@ -64,8 +63,7 @@ export const APP_BASE_HREF: OpaqueToken = CONST_EXPR(new OpaqueToken('appBaseHre
* Location * Location
* } from 'angular2/router'; * } from 'angular2/router';
* *
* @Component({...}) * @Component({directives: [ROUTER_DIRECTIVES]})
* @View({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([ * @RouteConfig([
* {...}, * {...},
* ]) * ])

View File

@ -23,7 +23,7 @@ import {LocationStrategy} from './location_strategy';
* ## Example * ## Example
* *
* ``` * ```
* import {Component, View, provide} from 'angular2/angular2'; * import {Component, provide} from 'angular2/angular2';
* import { * import {
* APP_BASE_HREF * APP_BASE_HREF
* ROUTER_DIRECTIVES, * ROUTER_DIRECTIVES,
@ -32,8 +32,7 @@ import {LocationStrategy} from './location_strategy';
* Location * Location
* } from 'angular2/router'; * } from 'angular2/router';
* *
* @Component({...}) * @Component({directives: [ROUTER_DIRECTIVES]})
* @View({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([ * @RouteConfig([
* {...}, * {...},
* ]) * ])