Skip to content

Commit b967847

Browse files
committed
chore(docs): remove @view decorator from examples in docs
Closes angular#4666
1 parent 62005dd commit b967847

36 files changed

Lines changed: 181 additions & 263 deletions

modules/angular2/http.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ export {URLSearchParams} from './src/http/url_search_params';
5151
*
5252
* @Component({
5353
* selector: 'app',
54-
* providers: [HTTP_PROVIDERS]
55-
* })
56-
* @View({
54+
* providers: [HTTP_PROVIDERS],
5755
* template: `
5856
* <div>
5957
* <h1>People</h1>
@@ -183,9 +181,7 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS;
183181
*
184182
* @Component({
185183
* selector: 'app',
186-
* providers: [JSONP_PROVIDERS]
187-
* })
188-
* @View({
184+
* providers: [JSONP_PROVIDERS],
189185
* template: `
190186
* <div>
191187
* <h1>People</h1>

modules/angular2/router.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,14 @@ import {BaseException} from 'angular2/src/core/facade/exceptions';
4141
* ## Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))
4242
*
4343
* ```
44-
* import {Component, View} from 'angular2/angular2';
44+
* import {Component} from 'angular2/angular2';
4545
* import {
4646
* ROUTER_DIRECTIVES,
4747
* ROUTER_PROVIDERS,
4848
* RouteConfig
4949
* } from 'angular2/router';
5050
*
51-
* @Component({...})
52-
* @View({directives: [ROUTER_DIRECTIVES]})
51+
* @Component({directives: [ROUTER_DIRECTIVES]})
5352
* @RouteConfig([
5453
* {...},
5554
* ])
@@ -71,11 +70,10 @@ export const ROUTER_PRIMARY_COMPONENT: OpaqueToken =
7170
* ## Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))
7271
*
7372
* ```
74-
* import {Component, View} from 'angular2/angular2';
73+
* import {Component} from 'angular2/angular2';
7574
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
7675
*
77-
* @Component({...})
78-
* @View({directives: [ROUTER_DIRECTIVES]})
76+
* @Component({directives: [ROUTER_DIRECTIVES]})
7977
* @RouteConfig([
8078
* {...},
8179
* ])
@@ -94,15 +92,14 @@ export const ROUTER_DIRECTIVES: any[] = CONST_EXPR([RouterOutlet, RouterLink]);
9492
* ## Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))
9593
*
9694
* ```
97-
* import {Component, View} from 'angular2/angular2';
95+
* import {Component} from 'angular2/angular2';
9896
* import {
9997
* ROUTER_DIRECTIVES,
10098
* ROUTER_PROVIDERS,
10199
* RouteConfig
102100
* } from 'angular2/router';
103101
*
104-
* @Component({...})
105-
* @View({directives: [ROUTER_DIRECTIVES]})
102+
* @Component({directives: [ROUTER_DIRECTIVES]})
106103
* @RouteConfig([
107104
* {...},
108105
* ])

modules/angular2/src/core/application_common.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ export function platform(bindings?: Array<Type | Provider | any[]>): PlatformRef
138138
*
139139
* ```
140140
* @Component({
141-
* selector: 'my-app'
142-
* })
143-
* @View({
141+
* selector: 'my-app',
144142
* template: 'Hello {{ name }}!'
145143
* })
146144
* class MyApp {

modules/angular2/src/core/application_tokens.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const APP_COMPONENT_REF_PROMISE = CONST_EXPR(new OpaqueToken('Promise<Com
1212
*
1313
* ```
1414
* @Component(...)
15-
* @View(...)
1615
* class MyApp {
1716
* ...
1817
* }

modules/angular2/src/core/change_detection/change_detector_ref.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ export abstract class ChangeDetectorRef {
1010
* ### Example ([live demo](http://plnkr.co/edit/GC512b?p=preview))
1111
*
1212
* ```typescript
13-
* @Component({selector: 'cmp', changeDetection: ChangeDetectionStrategy.OnPush})
14-
* @View({template: `Number of ticks: {{numberOfTicks}}`})
13+
* @Component({
14+
* selector: 'cmp',
15+
* changeDetection: ChangeDetectionStrategy.OnPush,
16+
* template: `Number of ticks: {{numberOfTicks}}`
17+
* })
1518
* class Cmp {
1619
* numberOfTicks = 0;
1720
*
@@ -26,9 +29,7 @@ export abstract class ChangeDetectorRef {
2629
*
2730
* @Component({
2831
* selector: 'app',
29-
* changeDetection: ChangeDetectionStrategy.OnPush
30-
* })
31-
* @View({
32+
* changeDetection: ChangeDetectionStrategy.OnPush,
3233
* template: `
3334
* <cmp><cmp>
3435
* `,
@@ -69,8 +70,8 @@ export abstract class ChangeDetectorRef {
6970
* }
7071
* }
7172
*
72-
* @Component({selector: 'giant-list'})
73-
* @View({
73+
* @Component({
74+
* selector: 'giant-list',
7475
* template: `
7576
* <li *ng-for="#d of dataProvider.data">Data {{d}}</lig>
7677
* `,
@@ -86,9 +87,8 @@ export abstract class ChangeDetectorRef {
8687
* }
8788
*
8889
* @Component({
89-
* selector: 'app', providers: [DataProvider]
90-
* })
91-
* @View({
90+
* selector: 'app',
91+
* providers: [DataProvider],
9292
* template: `
9393
* <giant-list><giant-list>
9494
* `,
@@ -151,8 +151,9 @@ export abstract class ChangeDetectorRef {
151151
* }
152152
* }
153153
*
154-
* @Component({selector: 'live-data', inputs: ['live']})
155-
* @View({
154+
* @Component({
155+
* selector: 'live-data',
156+
* inputs: ['live'],
156157
* template: `Data: {{dataProvider.data}}`
157158
* })
158159
* class LiveData {
@@ -168,9 +169,7 @@ export abstract class ChangeDetectorRef {
168169
*
169170
* @Component({
170171
* selector: 'app',
171-
* providers: [DataProvider]
172-
* })
173-
* @View({
172+
* providers: [DataProvider],
174173
* template: `
175174
* Live Update: <input type="checkbox" [(ng-model)]="live">
176175
* <live-data [live]="live"><live-data>

modules/angular2/src/core/change_detection/exceptions.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {BaseException, WrappedException} from "angular2/src/core/facade/exceptio
1010
* ### Example
1111
*
1212
* ```typescript
13-
* @Component({selector: 'parent'})
14-
* @View({
13+
* @Component({
14+
* selector: 'parent',
1515
* template: `
1616
* <child [prop]="parentProp"></child>
1717
* `,
@@ -55,9 +55,7 @@ export class ExpressionChangedAfterItHasBeenCheckedException extends BaseExcepti
5555
* }
5656
*
5757
* @Component({
58-
* selector: 'app'
59-
* })
60-
* @View({
58+
* selector: 'app',
6159
* template: `
6260
* <child [prop]="field.first"></child>
6361
* `,

modules/angular2/src/core/di/metadata.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ export class SkipSelfMetadata {
212212
*
213213
* @Component({
214214
* selector: 'parent-cmp',
215-
* providers: [HostService]
216-
* })
217-
* @View({
215+
* providers: [HostService],
218216
* template: `
219217
* Dir: <child-directive></child-directive>
220218
* `,
@@ -225,9 +223,7 @@ export class SkipSelfMetadata {
225223
*
226224
* @Component({
227225
* selector: 'app',
228-
* providers: [OtherService]
229-
* })
230-
* @View({
226+
* providers: [OtherService],
231227
* template: `
232228
* Parent: <parent-cmp></parent-cmp>
233229
* `,

modules/angular2/src/core/directives.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ export * from './directives/observable_list_diff';
3434
* import {OtherDirective} from './myDirectives';
3535
*
3636
* @Component({
37-
* selector: 'my-component'
38-
* })
39-
* @View({
37+
* selector: 'my-component',
4038
* templateUrl: 'myComponent.html',
4139
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
4240
* })
@@ -51,9 +49,7 @@ export * from './directives/observable_list_diff';
5149
* import {OtherDirective} from './myDirectives';
5250
*
5351
* @Component({
54-
* selector: 'my-component'
55-
* })
56-
* @View({
52+
* selector: 'my-component',
5753
* templateUrl: 'myComponent.html',
5854
* directives: [CORE_DIRECTIVES, OtherDirective]
5955
* })

modules/angular2/src/core/directives/ng_class.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ import {StringMapWrapper, isListLikeIterable} from 'angular2/src/core/facade/col
3030
* ### Example ([live demo](http://plnkr.co/edit/a4YdtmWywhJ33uqfpPPn?p=preview)):
3131
*
3232
* ```
33-
* import {Component, View, NgClass} from 'angular2/angular2';
33+
* import {Component, NgClass} from 'angular2/angular2';
3434
*
3535
* @Component({
36-
* selector: 'toggle-button',
37-
* inputs: ['isDisabled']
38-
* })
39-
* @View({
36+
* selector: 'toggle-button',
37+
* inputs: ['isDisabled'],
4038
* template: `
4139
* <div class="button" [ng-class]="{active: isOn, disabled: isDisabled}"
4240
* (click)="toggle(!isOn)">

modules/angular2/src/core/directives/ng_style.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ import {isPresent, isBlank, print} from 'angular2/src/core/facade/lang';
2323
* ### Example ([live demo](http://plnkr.co/edit/YamGS6GkUh9GqWNQhCyM?p=preview)):
2424
*
2525
* ```
26-
* import {Component, View, NgStyle} from 'angular2/angular2';
26+
* import {Component, NgStyle} from 'angular2/angular2';
2727
*
2828
* @Component({
29-
* selector: 'ng-style-example'
30-
* })
31-
* @View({
29+
* selector: 'ng-style-example',
3230
* template: `
3331
* <h1 [ng-style]="{'font-style': style, 'font-size': size, 'font-weight': weight}">
3432
* Change style of this text!

0 commit comments

Comments
 (0)