Skip to content

Commit

Permalink
chore(docs): remove @view decorator from examples in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Oct 11, 2015
1 parent 62005dd commit b967847
Show file tree
Hide file tree
Showing 36 changed files with 181 additions and 263 deletions.
8 changes: 2 additions & 6 deletions modules/angular2/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ export {URLSearchParams} from './src/http/url_search_params';
*
* @Component({
* selector: 'app',
* providers: [HTTP_PROVIDERS]
* })
* @View({
* providers: [HTTP_PROVIDERS],
* template: `
* <div>
* <h1>People</h1>
Expand Down Expand Up @@ -183,9 +181,7 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS;
*
* @Component({
* selector: 'app',
* providers: [JSONP_PROVIDERS]
* })
* @View({
* providers: [JSONP_PROVIDERS],
* template: `
* <div>
* <h1>People</h1>
Expand Down
15 changes: 6 additions & 9 deletions modules/angular2/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ import {BaseException} from 'angular2/src/core/facade/exceptions';
* ## 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';
*
* @Component({...})
* @View({directives: [ROUTER_DIRECTIVES]})
* @Component({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([
* {...},
* ])
Expand All @@ -71,11 +70,10 @@ export const ROUTER_PRIMARY_COMPONENT: OpaqueToken =
* ## 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';
*
* @Component({...})
* @View({directives: [ROUTER_DIRECTIVES]})
* @Component({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([
* {...},
* ])
Expand All @@ -94,15 +92,14 @@ export const ROUTER_DIRECTIVES: any[] = CONST_EXPR([RouterOutlet, RouterLink]);
* ## 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';
*
* @Component({...})
* @View({directives: [ROUTER_DIRECTIVES]})
* @Component({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([
* {...},
* ])
Expand Down
4 changes: 1 addition & 3 deletions modules/angular2/src/core/application_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ export function platform(bindings?: Array<Type | Provider | any[]>): PlatformRef
*
* ```
* @Component({
* selector: 'my-app'
* })
* @View({
* selector: 'my-app',
* template: 'Hello {{ name }}!'
* })
* class MyApp {
Expand Down
1 change: 0 additions & 1 deletion modules/angular2/src/core/application_tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const APP_COMPONENT_REF_PROMISE = CONST_EXPR(new OpaqueToken('Promise<Com
*
* ```
* @Component(...)
* @View(...)
* class MyApp {
* ...
* }
Expand Down
29 changes: 14 additions & 15 deletions modules/angular2/src/core/change_detection/change_detector_ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ export abstract class ChangeDetectorRef {
* ### Example ([live demo](http://plnkr.co/edit/GC512b?p=preview))
*
* ```typescript
* @Component({selector: 'cmp', changeDetection: ChangeDetectionStrategy.OnPush})
* @View({template: `Number of ticks: {{numberOfTicks}}`})
* @Component({
* selector: 'cmp',
* changeDetection: ChangeDetectionStrategy.OnPush,
* template: `Number of ticks: {{numberOfTicks}}`
* })
* class Cmp {
* numberOfTicks = 0;
*
Expand All @@ -26,9 +29,7 @@ export abstract class ChangeDetectorRef {
*
* @Component({
* selector: 'app',
* changeDetection: ChangeDetectionStrategy.OnPush
* })
* @View({
* changeDetection: ChangeDetectionStrategy.OnPush,
* template: `
* <cmp><cmp>
* `,
Expand Down Expand Up @@ -69,8 +70,8 @@ export abstract class ChangeDetectorRef {
* }
* }
*
* @Component({selector: 'giant-list'})
* @View({
* @Component({
* selector: 'giant-list',
* template: `
* <li *ng-for="#d of dataProvider.data">Data {{d}}</lig>
* `,
Expand All @@ -86,9 +87,8 @@ export abstract class ChangeDetectorRef {
* }
*
* @Component({
* selector: 'app', providers: [DataProvider]
* })
* @View({
* selector: 'app',
* providers: [DataProvider],
* template: `
* <giant-list><giant-list>
* `,
Expand Down Expand Up @@ -151,8 +151,9 @@ export abstract class ChangeDetectorRef {
* }
* }
*
* @Component({selector: 'live-data', inputs: ['live']})
* @View({
* @Component({
* selector: 'live-data',
* inputs: ['live'],
* template: `Data: {{dataProvider.data}}`
* })
* class LiveData {
Expand All @@ -168,9 +169,7 @@ export abstract class ChangeDetectorRef {
*
* @Component({
* selector: 'app',
* providers: [DataProvider]
* })
* @View({
* providers: [DataProvider],
* template: `
* Live Update: <input type="checkbox" [(ng-model)]="live">
* <live-data [live]="live"><live-data>
Expand Down
8 changes: 3 additions & 5 deletions modules/angular2/src/core/change_detection/exceptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {BaseException, WrappedException} from "angular2/src/core/facade/exceptio
* ### Example
*
* ```typescript
* @Component({selector: 'parent'})
* @View({
* @Component({
* selector: 'parent',
* template: `
* <child [prop]="parentProp"></child>
* `,
Expand Down Expand Up @@ -55,9 +55,7 @@ export class ExpressionChangedAfterItHasBeenCheckedException extends BaseExcepti
* }
*
* @Component({
* selector: 'app'
* })
* @View({
* selector: 'app',
* template: `
* <child [prop]="field.first"></child>
* `,
Expand Down
8 changes: 2 additions & 6 deletions modules/angular2/src/core/di/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,7 @@ export class SkipSelfMetadata {
*
* @Component({
* selector: 'parent-cmp',
* providers: [HostService]
* })
* @View({
* providers: [HostService],
* template: `
* Dir: <child-directive></child-directive>
* `,
Expand All @@ -225,9 +223,7 @@ export class SkipSelfMetadata {
*
* @Component({
* selector: 'app',
* providers: [OtherService]
* })
* @View({
* providers: [OtherService],
* template: `
* Parent: <parent-cmp></parent-cmp>
* `,
Expand Down
8 changes: 2 additions & 6 deletions modules/angular2/src/core/directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export * from './directives/observable_list_diff';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component'
* })
* @View({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* })
Expand All @@ -51,9 +49,7 @@ export * from './directives/observable_list_diff';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component'
* })
* @View({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [CORE_DIRECTIVES, OtherDirective]
* })
Expand Down
8 changes: 3 additions & 5 deletions modules/angular2/src/core/directives/ng_class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ import {StringMapWrapper, isListLikeIterable} from 'angular2/src/core/facade/col
* ### Example ([live demo](http://plnkr.co/edit/a4YdtmWywhJ33uqfpPPn?p=preview)):
*
* ```
* import {Component, View, NgClass} from 'angular2/angular2';
* import {Component, NgClass} from 'angular2/angular2';
*
* @Component({
* selector: 'toggle-button',
* inputs: ['isDisabled']
* })
* @View({
* selector: 'toggle-button',
* inputs: ['isDisabled'],
* template: `
* <div class="button" [ng-class]="{active: isOn, disabled: isDisabled}"
* (click)="toggle(!isOn)">
Expand Down
6 changes: 2 additions & 4 deletions modules/angular2/src/core/directives/ng_style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ import {isPresent, isBlank, print} from 'angular2/src/core/facade/lang';
* ### Example ([live demo](http://plnkr.co/edit/YamGS6GkUh9GqWNQhCyM?p=preview)):
*
* ```
* import {Component, View, NgStyle} from 'angular2/angular2';
* import {Component, NgStyle} from 'angular2/angular2';
*
* @Component({
* selector: 'ng-style-example'
* })
* @View({
* selector: 'ng-style-example',
* template: `
* <h1 [ng-style]="{'font-style': style, 'font-size': size, 'font-weight': weight}">
* Change style of this text!
Expand Down
5 changes: 3 additions & 2 deletions modules/angular2/src/core/facade/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ export class Observable {
* title gets clicked:
*
* ```
* @Component({selector: 'zippy'})
* @View({template: `
* @Component({
* selector: 'zippy',
* template: `
* <div class="zippy">
* <div (click)="toggle()">Toggle</div>
* <div [hidden]="!visible">
Expand Down
6 changes: 2 additions & 4 deletions modules/angular2/src/core/forms/directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ export {NgControlStatus} from './directives/ng_control_status';
* ### Example:
*
* ```typescript
* @View({
* directives: [FORM_DIRECTIVES]
* })
* @Component({
* selector: 'my-app'
* selector: 'my-app',
* directives: [FORM_DIRECTIVES]
* })
* class MyApp {}
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const controlGroupBinding =
* We can work with each group separately: check its validity, get its value, listen to its changes.
*
* ```
* @Component({selector: "signup-comp"})
* @View({
* @Component({
* selector: "signup-comp",
* directives: [FORM_DIRECTIVES],
* template: `
* <form #f="form" (submit)='onSignUp(f.value)'>
Expand Down
8 changes: 4 additions & 4 deletions modules/angular2/src/core/forms/directives/ng_control_name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const controlNameBinding =
* changes.
*
* ```
* @Component({selector: "login-comp"})
* @View({
* @Component({
* selector: "login-comp",
* directives: [FORM_DIRECTIVES],
* template: `
* <form #f="form" (submit)='onLogIn(f.value)'>
Expand All @@ -50,8 +50,8 @@ const controlNameBinding =
* We can also use ng-model to bind a domain model to the form.
*
* ```
* @Component({selector: "login-comp"})
* @View({
* @Component({
* selector: "login-comp",
* directives: [FORM_DIRECTIVES],
* template: `
* <form (submit)='onLogIn()'>
Expand Down
4 changes: 1 addition & 3 deletions modules/angular2/src/core/forms/directives/ng_form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ const formDirectiveProvider =
*
* ```typescript
* @Component({
* selector: 'my-app'
* })
* @View({
* selector: 'my-app',
* template: `
* <div>
* <p>Submit the form to see the data object Angular builds</p>
Expand Down
8 changes: 3 additions & 5 deletions modules/angular2/src/core/forms/directives/ng_form_control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ const formControlBinding =
*
* ```typescript
* @Component({
* selector: 'my-app'
* })
* @View({
* selector: 'my-app',
* template: `
* <div>
* <h2>NgFormControl Example</h2>
Expand All @@ -51,8 +49,8 @@ const formControlBinding =
* ### Example ([live demo](http://plnkr.co/edit/yHMLuHO7DNgT8XvtjTDH?p=preview))
*
* ```typescript
* @Component({selector: "login-comp"})
* @View({
* @Component({
* selector: "login-comp",
* directives: [FORM_DIRECTIVES],
* template: "<input type='text' [ng-form-control]='loginControl' [(ng-model)]='login'>"
* })
Expand Down
8 changes: 3 additions & 5 deletions modules/angular2/src/core/forms/directives/ng_form_model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const formDirectiveProvider =
*
* ```typescript
* @Component({
* selector: 'my-app'
* })
* @View({
* selector: 'my-app',
* template: `
* <div>
* <h2>NgFormModel Example</h2>
Expand Down Expand Up @@ -60,8 +58,8 @@ const formDirectiveProvider =
* We can also use ng-model to bind a domain model to the form.
*
* ```typescript
* @Component({selector: "login-comp"})
* @View({
* @Component({
* selector: "login-comp",
* directives: [FORM_DIRECTIVES],
* template: `
* <form [ng-form-model]='loginForm'>
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/forms/directives/ng_model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const formControlBinding =
*
* ### Example ([live demo](http://plnkr.co/edit/R3UX5qDaUqFO2VYR0UzH?p=preview))
* ```typescript
* @Component({selector: "search-comp"})
* @View({
* @Component({
* selector: "search-comp",
* directives: [FORM_DIRECTIVES],
* template: `<input type='text' [(ng-model)]="searchQuery">`
* })
Expand Down
Loading

0 comments on commit b967847

Please sign in to comment.