diff --git a/modules/angular2/http.ts b/modules/angular2/http.ts index 18e67cd7c3..09f7b2399c 100644 --- a/modules/angular2/http.ts +++ b/modules/angular2/http.ts @@ -51,9 +51,7 @@ export {URLSearchParams} from './src/http/url_search_params'; * * @Component({ * selector: 'app', - * providers: [HTTP_PROVIDERS] - * }) - * @View({ + * providers: [HTTP_PROVIDERS], * template: ` *
*

People

@@ -183,9 +181,7 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS; * * @Component({ * selector: 'app', - * providers: [JSONP_PROVIDERS] - * }) - * @View({ + * providers: [JSONP_PROVIDERS], * template: ` *
*

People

diff --git a/modules/angular2/router.ts b/modules/angular2/router.ts index 967a785f93..17dc9c8ad4 100644 --- a/modules/angular2/router.ts +++ b/modules/angular2/router.ts @@ -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([ * {...}, * ]) @@ -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([ * {...}, * ]) @@ -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([ * {...}, * ]) diff --git a/modules/angular2/src/core/application_common.ts b/modules/angular2/src/core/application_common.ts index 9e5aa6a4b7..fd0e2924eb 100644 --- a/modules/angular2/src/core/application_common.ts +++ b/modules/angular2/src/core/application_common.ts @@ -138,9 +138,7 @@ export function platform(bindings?: Array): PlatformRef * * ``` * @Component({ - * selector: 'my-app' - * }) - * @View({ + * selector: 'my-app', * template: 'Hello {{ name }}!' * }) * class MyApp { diff --git a/modules/angular2/src/core/application_tokens.ts b/modules/angular2/src/core/application_tokens.ts index e8cc58a5a7..1021f60be2 100644 --- a/modules/angular2/src/core/application_tokens.ts +++ b/modules/angular2/src/core/application_tokens.ts @@ -12,7 +12,6 @@ export const APP_COMPONENT_REF_PROMISE = CONST_EXPR(new OpaqueToken('Promise * `, @@ -69,8 +70,8 @@ export abstract class ChangeDetectorRef { * } * } * - * @Component({selector: 'giant-list'}) - * @View({ + * @Component({ + * selector: 'giant-list', * template: ` *
  • Data {{d}} * `, @@ -86,9 +87,8 @@ export abstract class ChangeDetectorRef { * } * * @Component({ - * selector: 'app', providers: [DataProvider] - * }) - * @View({ + * selector: 'app', + * providers: [DataProvider], * template: ` * * `, @@ -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 { @@ -168,9 +169,7 @@ export abstract class ChangeDetectorRef { * * @Component({ * selector: 'app', - * providers: [DataProvider] - * }) - * @View({ + * providers: [DataProvider], * template: ` * Live Update: * diff --git a/modules/angular2/src/core/change_detection/exceptions.ts b/modules/angular2/src/core/change_detection/exceptions.ts index 6da450ea84..7bb1a2d7d7 100644 --- a/modules/angular2/src/core/change_detection/exceptions.ts +++ b/modules/angular2/src/core/change_detection/exceptions.ts @@ -10,8 +10,8 @@ import {BaseException, WrappedException} from "angular2/src/core/facade/exceptio * ### Example * * ```typescript - * @Component({selector: 'parent'}) - * @View({ + * @Component({ + * selector: 'parent', * template: ` * * `, @@ -55,9 +55,7 @@ export class ExpressionChangedAfterItHasBeenCheckedException extends BaseExcepti * } * * @Component({ - * selector: 'app' - * }) - * @View({ + * selector: 'app', * template: ` * * `, diff --git a/modules/angular2/src/core/di/metadata.ts b/modules/angular2/src/core/di/metadata.ts index bda69c3dd7..8c9b9ca391 100644 --- a/modules/angular2/src/core/di/metadata.ts +++ b/modules/angular2/src/core/di/metadata.ts @@ -212,9 +212,7 @@ export class SkipSelfMetadata { * * @Component({ * selector: 'parent-cmp', - * providers: [HostService] - * }) - * @View({ + * providers: [HostService], * template: ` * Dir: * `, @@ -225,9 +223,7 @@ export class SkipSelfMetadata { * * @Component({ * selector: 'app', - * providers: [OtherService] - * }) - * @View({ + * providers: [OtherService], * template: ` * Parent: * `, diff --git a/modules/angular2/src/core/directives.ts b/modules/angular2/src/core/directives.ts index 4422b02ffa..8ff8399604 100644 --- a/modules/angular2/src/core/directives.ts +++ b/modules/angular2/src/core/directives.ts @@ -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] * }) @@ -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] * }) diff --git a/modules/angular2/src/core/directives/ng_class.ts b/modules/angular2/src/core/directives/ng_class.ts index 2fbea18f3a..6396aa7f8f 100644 --- a/modules/angular2/src/core/directives/ng_class.ts +++ b/modules/angular2/src/core/directives/ng_class.ts @@ -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: ` *
    diff --git a/modules/angular2/src/core/directives/ng_style.ts b/modules/angular2/src/core/directives/ng_style.ts index 8390b64ca7..a807b3888f 100644 --- a/modules/angular2/src/core/directives/ng_style.ts +++ b/modules/angular2/src/core/directives/ng_style.ts @@ -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: ` *

    * Change style of this text! diff --git a/modules/angular2/src/core/facade/async.ts b/modules/angular2/src/core/facade/async.ts index ee5fff7743..3c9dca2b68 100644 --- a/modules/angular2/src/core/facade/async.ts +++ b/modules/angular2/src/core/facade/async.ts @@ -104,8 +104,9 @@ export class Observable { * title gets clicked: * * ``` - * @Component({selector: 'zippy'}) - * @View({template: ` + * @Component({ + * selector: 'zippy', + * template: ` *
    *
    Toggle
    *
    diff --git a/modules/angular2/src/core/forms/directives.ts b/modules/angular2/src/core/forms/directives.ts index 346532022d..f543619976 100644 --- a/modules/angular2/src/core/forms/directives.ts +++ b/modules/angular2/src/core/forms/directives.ts @@ -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 {} * ``` diff --git a/modules/angular2/src/core/forms/directives/ng_control_group.ts b/modules/angular2/src/core/forms/directives/ng_control_group.ts index 6b9fefce43..2186960a38 100644 --- a/modules/angular2/src/core/forms/directives/ng_control_group.ts +++ b/modules/angular2/src/core/forms/directives/ng_control_group.ts @@ -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: ` *
    diff --git a/modules/angular2/src/core/forms/directives/ng_control_name.ts b/modules/angular2/src/core/forms/directives/ng_control_name.ts index 87ab279eb2..97b16106b8 100644 --- a/modules/angular2/src/core/forms/directives/ng_control_name.ts +++ b/modules/angular2/src/core/forms/directives/ng_control_name.ts @@ -28,8 +28,8 @@ const controlNameBinding = * changes. * * ``` - * @Component({selector: "login-comp"}) - * @View({ + * @Component({ + * selector: "login-comp", * directives: [FORM_DIRECTIVES], * template: ` * @@ -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: ` * diff --git a/modules/angular2/src/core/forms/directives/ng_form.ts b/modules/angular2/src/core/forms/directives/ng_form.ts index 0cea08f6b6..dac6298d5f 100644 --- a/modules/angular2/src/core/forms/directives/ng_form.ts +++ b/modules/angular2/src/core/forms/directives/ng_form.ts @@ -42,9 +42,7 @@ const formDirectiveProvider = * * ```typescript * @Component({ - * selector: 'my-app' - * }) - * @View({ + * selector: 'my-app', * template: ` *
    *

    Submit the form to see the data object Angular builds

    diff --git a/modules/angular2/src/core/forms/directives/ng_form_control.ts b/modules/angular2/src/core/forms/directives/ng_form_control.ts index cbf982dd34..ce4cf3153f 100644 --- a/modules/angular2/src/core/forms/directives/ng_form_control.ts +++ b/modules/angular2/src/core/forms/directives/ng_form_control.ts @@ -24,9 +24,7 @@ const formControlBinding = * * ```typescript * @Component({ - * selector: 'my-app' - * }) - * @View({ + * selector: 'my-app', * template: ` *
    *

    NgFormControl Example

    @@ -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: "" * }) diff --git a/modules/angular2/src/core/forms/directives/ng_form_model.ts b/modules/angular2/src/core/forms/directives/ng_form_model.ts index ab48f914b8..b411979366 100644 --- a/modules/angular2/src/core/forms/directives/ng_form_model.ts +++ b/modules/angular2/src/core/forms/directives/ng_form_model.ts @@ -25,9 +25,7 @@ const formDirectiveProvider = * * ```typescript * @Component({ - * selector: 'my-app' - * }) - * @View({ + * selector: 'my-app', * template: ` *
    *

    NgFormModel Example

    @@ -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: ` * diff --git a/modules/angular2/src/core/forms/directives/ng_model.ts b/modules/angular2/src/core/forms/directives/ng_model.ts index e1eb6ecee2..6d95e9c6bb 100644 --- a/modules/angular2/src/core/forms/directives/ng_model.ts +++ b/modules/angular2/src/core/forms/directives/ng_model.ts @@ -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: `` * }) diff --git a/modules/angular2/src/core/forms/form_builder.ts b/modules/angular2/src/core/forms/form_builder.ts index e9326063d8..db41546713 100644 --- a/modules/angular2/src/core/forms/form_builder.ts +++ b/modules/angular2/src/core/forms/form_builder.ts @@ -10,14 +10,12 @@ import * as modelModule from './model'; * # Example * * ``` - * import {Component, View, bootstrap} from 'angular2/angular2'; + * import {Component, bootstrap} from 'angular2/angular2'; * import {FormBuilder, Validators, FORM_DIRECTIVES, ControlGroup} from 'angular2/core'; * * @Component({ * selector: 'login-comp', - * viewProviders: [FormBuilder] - * }) - * @View({ + * viewProviders: [FormBuilder], * template: ` * * Login diff --git a/modules/angular2/src/core/linker/interfaces.ts b/modules/angular2/src/core/linker/interfaces.ts index b32f97c38f..654c6ce4b5 100644 --- a/modules/angular2/src/core/linker/interfaces.ts +++ b/modules/angular2/src/core/linker/interfaces.ts @@ -50,8 +50,10 @@ export var LIFECYCLE_HOOKS_VALUES = [ * ### Example ([live example](http://plnkr.co/edit/AHrB6opLqHDBPkt4KpdT?p=preview)): * * ```typescript - * @Component({selector: 'my-cmp'}) - * @View({template: `

    myProp = {{myProp}}

    `}) + * @Component({ + * selector: 'my-cmp', + * template: `

    myProp = {{myProp}}

    ` + * }) * class MyComponent implements OnChanges { * @Input() myProp: any; * @@ -60,8 +62,8 @@ export var LIFECYCLE_HOOKS_VALUES = [ * } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ` * * `, @@ -87,8 +89,10 @@ export interface OnChanges { onChanges(changes: {[key: string]: SimpleChange}); * ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview)) * * ```typescript - * @Component({selector: 'my-cmp'}) - * @View({template: `

    my-component

    `}) + * @Component({ + * selector: 'my-cmp', + * template: `

    my-component

    ` + * }) * class MyComponent implements OnInit, OnDestroy { * onInit() { * console.log('onInit'); @@ -99,8 +103,8 @@ export interface OnChanges { onChanges(changes: {[key: string]: SimpleChange}); * } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ` * * @@ -193,8 +197,10 @@ export interface DoCheck { doCheck(); } * ### Example ([live example](http://plnkr.co/edit/1MBypRryXd64v4pV03Yn?p=preview)) * * ```typesript - * @Component({selector: 'my-cmp'}) - * @View({template: `

    my-component

    `}) + * @Component({ + * selector: 'my-cmp', + * template: `

    my-component

    ` + * }) * class MyComponent implements OnInit, OnDestroy { * onInit() { * console.log('onInit'); @@ -205,8 +211,8 @@ export interface DoCheck { doCheck(); } * } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ` * @@ -328,14 +336,13 @@ export interface AfterContentChecked { afterContentChecked(); } * ### Example ([live demo](http://plnkr.co/edit/LhTKVMEM0fkJgyp4CI1W?p=preview)) * * ```typescript - * @Component({selector: 'child-cmp'}) - * @View({template: `{{where}} child`}) + * @Component({selector: 'child-cmp', template: `{{where}} child`}) * class ChildComponent { * @Input() where: string; * } * - * @Component({selector: 'parent-cmp'}) - * @View({ + * @Component({ + * selector: 'parent-cmp', * template: ``, * directives: [ChildComponent] * }) @@ -357,8 +364,8 @@ export interface AfterContentChecked { afterContentChecked(); } * } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ``, * directives: [ParentComponent] * }) @@ -376,14 +383,13 @@ export interface AfterViewInit { afterViewInit(); } * ### Example ([live demo](http://plnkr.co/edit/0qDGHcPQkc25CXhTNzKU?p=preview)) * * ```typescript - * @Component({selector: 'child-cmp'}) - * @View({template: `{{where}} child`}) + * @Component({selector: 'child-cmp', template: `{{where}} child`}) * class ChildComponent { * @Input() where: string; * } * - * @Component({selector: 'parent-cmp'}) - * @View({ + * @Component({ + * selector: 'parent-cmp', * template: ` * * `, @@ -408,8 +414,8 @@ export interface AfterViewInit { afterViewInit(); } * } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ``, * directives: [ParentComponent] * }) diff --git a/modules/angular2/src/core/metadata.ts b/modules/angular2/src/core/metadata.ts index 5f15a0cf63..9458f62c52 100644 --- a/modules/angular2/src/core/metadata.ts +++ b/modules/angular2/src/core/metadata.ts @@ -179,10 +179,9 @@ export interface DirectiveFactory { * ## Example as TypeScript Decorator * * ``` - * import {Component, View} from "angular2/angular2"; + * import {Component} from "angular2/angular2"; * * @Component({...}) - * @View({...}) * class MyComponent { * constructor() { * ... @@ -195,7 +194,6 @@ export interface DirectiveFactory { * ``` * var MyComponent = ng * .Component({...}) - * .View({...}) * .Class({ * constructor: function() { * ... @@ -211,8 +209,7 @@ export interface DirectiveFactory { * }; * * MyComponent.annotations = [ - * new ng.Component({...}), - * new ng.View({...}) + * new ng.Component({...}) * ] * ``` */ @@ -338,10 +335,9 @@ export interface ViewFactory { * ## Example as TypeScript Decorator * * ``` - * import {Attribute, Component, View} from "angular2/angular2"; + * import {Attribute, Component} from "angular2/angular2"; * * @Component({...}) - * @View({...}) * class MyComponent { * constructor(@Attribute('title') title: string) { * ... @@ -354,7 +350,6 @@ export interface ViewFactory { * ``` * var MyComponent = ng * .Component({...}) - * .View({...}) * .Class({ * constructor: [new ng.Attribute('title'), function(title) { * ... @@ -370,8 +365,7 @@ export interface ViewFactory { * }; * * MyComponent.annotations = [ - * new ng.Component({...}), - * new ng.View({...}) + * new ng.Component({...}) * ] * MyComponent.parameters = [ * [new ng.Attribute('title')] @@ -389,10 +383,9 @@ export interface AttributeFactory { * ### Example as TypeScript Decorator * * ``` - * import {Query, QueryList, Component, View} from "angular2/angular2"; + * import {Query, QueryList, Component} from "angular2/angular2"; * * @Component({...}) - * @View({...}) * class MyComponent { * constructor(@Query(SomeType) queryList: QueryList) { * ... @@ -405,7 +398,6 @@ export interface AttributeFactory { * ``` * var MyComponent = ng * .Component({...}) - * .View({...}) * .Class({ * constructor: [new ng.Query(SomeType), function(queryList) { * ... @@ -421,8 +413,7 @@ export interface AttributeFactory { * }; * * MyComponent.annotations = [ - * new ng.Component({...}), - * new ng.View({...}) + * new ng.Component({...}) * ] * MyComponent.parameters = [ * [new ng.Query(SomeType)] diff --git a/modules/angular2/src/core/metadata/di.ts b/modules/angular2/src/core/metadata/di.ts index e5369eba19..bbb8060ee7 100644 --- a/modules/angular2/src/core/metadata/di.ts +++ b/modules/angular2/src/core/metadata/di.ts @@ -73,15 +73,12 @@ export class AttributeMetadata extends DependencyMetadata { * selector: 'pane', * inputs: ['title'] * }) - * @View(...) * class Pane { * title:string; * } * * @Component({ - * selector: 'tabs' - * }) - * @View({ + * selector: 'tabs', * template: ` *
      *
    • {{pane.title}}
    • @@ -105,10 +102,7 @@ export class AttributeMetadata extends DependencyMetadata { *
      ...
      * * - * @Component({ - * selector: 'foo' - * }) - * @View(...) + * @Component({ selector: 'foo' }) * class seeker { * constructor(@Query('findme') elList: QueryList) {...} * } @@ -128,7 +122,6 @@ export class AttributeMetadata extends DependencyMetadata { * @Component({ * selector: 'foo' * }) - * @View(...) * class Seeker { * constructor(@Query('findMe, findMeToo') elList: QueryList) {...} * } @@ -316,9 +309,10 @@ export class ViewQueryMetadata extends QueryMetadata { * * ``` * @Component({ - * selector: 'someDir' + * selector: 'someDir', + * templateUrl: 'someTemplate', + * directives: [ItemDirective] * }) - * @View({templateUrl: 'someTemplate', directives: [ItemDirective]}) * class SomeDir { * @ViewChildren(ItemDirective) viewChildren: QueryList; * @@ -342,9 +336,10 @@ export class ViewChildrenMetadata extends ViewQueryMetadata { * * ``` * @Component({ - * selector: 'someDir' + * selector: 'someDir', + * templateUrl: 'someTemplate', + * directives: [ItemDirective] * }) - * @View({templateUrl: 'someTemplate', directives: [ItemDirective]}) * class SomeDir { * @ViewChild(ItemDirective) viewChild:ItemDirective; * @@ -357,4 +352,4 @@ export class ViewChildrenMetadata extends ViewQueryMetadata { @CONST() export class ViewChildMetadata extends ViewQueryMetadata { constructor(_selector: Type | string) { super(_selector, {descendants: true, first: true}); } -} \ No newline at end of file +} diff --git a/modules/angular2/src/core/metadata/directives.ts b/modules/angular2/src/core/metadata/directives.ts index 0c904096c8..865c530628 100644 --- a/modules/angular2/src/core/metadata/directives.ts +++ b/modules/angular2/src/core/metadata/directives.ts @@ -437,9 +437,7 @@ export class DirectiveMetadata extends InjectableMetadata { * ```typescript * @Component({ * selector: 'bank-account', - * inputs: ['bankName', 'id: account-id'] - * }) - * @View({ + * inputs: ['bankName', 'id: account-id'], * template: ` * Bank Name: {{bankName}} * Account Id: {{id}} @@ -453,8 +451,8 @@ export class DirectiveMetadata extends InjectableMetadata { * normalizedBankName: string; * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ` * * `, @@ -503,8 +501,8 @@ export class DirectiveMetadata extends InjectableMetadata { * } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ` * * @@ -564,8 +562,8 @@ export class DirectiveMetadata extends InjectableMetadata { * } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ``, * directives: [CountClicks] * }) @@ -600,8 +598,8 @@ export class DirectiveMetadata extends InjectableMetadata { * get invalid { return this.control.invalid; } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ``, * directives: [FORM_DIRECTIVES, NgModelStatus] * }) @@ -688,8 +686,6 @@ export class DirectiveMetadata extends InjectableMetadata { * * @Component({ * selector: 'main', - * }) - * @View({ * template: ``, * directives: [ChildDir] * }) @@ -735,9 +731,7 @@ export class DirectiveMetadata extends InjectableMetadata { * queries: { * contentChildren: new ContentChildren(ChildDirective), * viewChildren: new ViewChildren(ChildDirective) - * } - * }) - * @View({ + * }, * template: '', * directives: [ChildDirective] * }) @@ -812,9 +806,7 @@ export class DirectiveMetadata extends InjectableMetadata { * * ``` * @Component({ - * selector: 'greet' - * }) - * @View({ + * selector: 'greet', * template: 'Hello {{name}}!' * }) * class Greet { @@ -869,9 +861,7 @@ export class ComponentMetadata extends DirectiveMetadata { * selector: 'greet', * viewProviders: [ * Greeter - * ] - * }) - * @View({ + * ], * template: ``, * directives: [NeedsGreeter] * }) @@ -998,8 +988,8 @@ export class PipeMetadata extends InjectableMetadata { * The following example creates a component with two input properties. * * ```typescript - * @Component({selector: 'bank-account'}) - * @View({ + * @Component({ + * selector: 'bank-account', * template: ` * Bank Name: {{bankName}} * Account Id: {{id}} @@ -1013,8 +1003,8 @@ export class PipeMetadata extends InjectableMetadata { * normalizedBankName: string; * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ` * * `, @@ -1060,8 +1050,8 @@ export class InputMetadata { * } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ` * * @@ -1103,8 +1093,8 @@ export class OutputMetadata { * @HostBinding('[class.invalid]') get invalid { return this.control.invalid; } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ``, * directives: [FORM_DIRECTIVES, NgModelStatus] * }) @@ -1144,8 +1134,8 @@ export class HostBindingMetadata { * } * } * - * @Component({selector: 'app'}) - * @View({ + * @Component({ + * selector: 'app', * template: ``, * directives: [CountClicks] * }) diff --git a/modules/angular2/src/core/metadata/view.ts b/modules/angular2/src/core/metadata/view.ts index c3e44bcbb6..cdb3a8d313 100644 --- a/modules/angular2/src/core/metadata/view.ts +++ b/modules/angular2/src/core/metadata/view.ts @@ -48,9 +48,7 @@ export var VIEW_ENCAPSULATION_VALUES = * * ``` * @Component({ - * selector: 'greet' - * }) - * @View({ + * selector: 'greet', * template: 'Hello {{name}}!', * directives: [GreetUser, Bold] * }) @@ -102,9 +100,7 @@ export class ViewMetadata { * * ```javascript * @Component({ - * selector: 'my-component' - * }) - * @View({ + * selector: 'my-component', * directives: [NgFor] * template: ' *
        diff --git a/modules/angular2/src/core/pipes/async_pipe.ts b/modules/angular2/src/core/pipes/async_pipe.ts index 6cc661a708..892f787ebf 100644 --- a/modules/angular2/src/core/pipes/async_pipe.ts +++ b/modules/angular2/src/core/pipes/async_pipe.ts @@ -47,9 +47,7 @@ var _observableStrategy = new ObservableStrategy(); * ``` * import {Observable} from 'angular2/core'; * @Component({ - * selector: "task-cmp" - * }) - * @View({ + * selector: "task-cmp", * template: "Time: {{ time | async }}" * }) * class Task { diff --git a/modules/angular2/src/core/pipes/json_pipe.ts b/modules/angular2/src/core/pipes/json_pipe.ts index 092d8b301d..6547e8c387 100644 --- a/modules/angular2/src/core/pipes/json_pipe.ts +++ b/modules/angular2/src/core/pipes/json_pipe.ts @@ -12,9 +12,7 @@ import {Pipe} from 'angular2/src/core/metadata'; * * ``` * @Component({ - * selector: "user-cmp" - * }) - * @View({ + * selector: "user-cmp", * template: "User: {{ user | json }}" * }) * class Username { diff --git a/modules/angular2/src/core/pipes/lowercase_pipe.ts b/modules/angular2/src/core/pipes/lowercase_pipe.ts index 04abc6c906..04ab977a86 100644 --- a/modules/angular2/src/core/pipes/lowercase_pipe.ts +++ b/modules/angular2/src/core/pipes/lowercase_pipe.ts @@ -14,9 +14,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception'; * * ``` * @Component({ - * selector: "username-cmp" - * }) - * @View({ + * selector: "username-cmp", * template: "Username: {{ user | lowercase }}" * }) * class Username { diff --git a/modules/angular2/src/core/pipes/uppercase_pipe.ts b/modules/angular2/src/core/pipes/uppercase_pipe.ts index a46243f682..11d6b809eb 100644 --- a/modules/angular2/src/core/pipes/uppercase_pipe.ts +++ b/modules/angular2/src/core/pipes/uppercase_pipe.ts @@ -13,9 +13,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception'; * * ``` * @Component({ - * selector: "username-cmp" - * }) - * @View({ + * selector: "username-cmp", * template: "Username: {{ user | uppercase }}" * }) * class Username { diff --git a/modules/angular2/src/core/zone/ng_zone.ts b/modules/angular2/src/core/zone/ng_zone.ts index 414a7bf20e..5e3fdbda7a 100644 --- a/modules/angular2/src/core/zone/ng_zone.ts +++ b/modules/angular2/src/core/zone/ng_zone.ts @@ -26,9 +26,7 @@ export interface NgZoneZone extends Zone { * import {Component, View, NgIf, NgZone} from 'angular2/angular2'; * * @Component({ - * selector: 'ng-zone-demo' - * }) - * @View({ + * selector: 'ng-zone-demo'. * template: ` *

        Demo: NgZone

        * diff --git a/modules/angular2/src/http/http.ts b/modules/angular2/src/http/http.ts index 1e201b852d..528aee34ed 100644 --- a/modules/angular2/src/http/http.ts +++ b/modules/angular2/src/http/http.ts @@ -40,8 +40,11 @@ function mergeOptions(defaultOpts, providedOpts, method, url): RequestOptions { * * ```typescript * import {Http, HTTP_PROVIDERS} from 'angular2/http'; - * @Component({selector: 'http-app', viewProviders: [HTTP_PROVIDERS]}) - * @View({templateUrl: 'people.html'}) + * @Component({ + * selector: 'http-app', + * viewProviders: [HTTP_PROVIDERS], + * templateUrl: 'people.html' + * }) * class PeopleComponent { * constructor(http: Http) { * http.get('people.json') diff --git a/modules/angular2/src/router/hash_location_strategy.ts b/modules/angular2/src/router/hash_location_strategy.ts index e2a59eaf06..7c14beef0d 100644 --- a/modules/angular2/src/router/hash_location_strategy.ts +++ b/modules/angular2/src/router/hash_location_strategy.ts @@ -23,8 +23,7 @@ import {EventListener, History, Location} from 'angular2/src/core/facade/browser * Location * } from 'angular2/router'; * - * @Component({...}) - * @View({directives: [ROUTER_DIRECTIVES]}) + * @Component({directives: [ROUTER_DIRECTIVES]}) * @RouteConfig([ * {...}, * ]) diff --git a/modules/angular2/src/router/instruction.ts b/modules/angular2/src/router/instruction.ts index 40e813002c..26571d1eb6 100644 --- a/modules/angular2/src/router/instruction.ts +++ b/modules/angular2/src/router/instruction.ts @@ -15,18 +15,16 @@ import {Url} from './url_parser'; * ## Example * * ``` - * import {bootstrap, Component, View} from 'angular2/angular2'; + * import {bootstrap, Component} from 'angular2/angular2'; * import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; * - * @Component({...}) - * @View({directives: [ROUTER_DIRECTIVES]}) + * @Component({directives: [ROUTER_DIRECTIVES]}) * @RouteConfig([ * {path: '/user/:id', component: UserCmp, as: 'UserCmp'}, * ]) * class AppCmp {} * - * @Component({...}) - * @View({ template: 'user: {{id}}' }) + * @Component({ template: 'user: {{id}}' }) * class UserCmp { * string: id; * constructor(params: RouteParams) { @@ -53,11 +51,10 @@ export class RouteParams { * ## Example * * ``` - * import {bootstrap, Component, View} from 'angular2/angular2'; + * import {bootstrap, Component} from 'angular2/angular2'; * import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; * - * @Component({...}) - * @View({directives: [ROUTER_DIRECTIVES]}) + * @Component({directives: [ROUTER_DIRECTIVES]}) * @RouteConfig([ * {...}, * ]) diff --git a/modules/angular2/src/router/interfaces.ts b/modules/angular2/src/router/interfaces.ts index 3d9cdc5fef..6d30be5b5a 100644 --- a/modules/angular2/src/router/interfaces.ts +++ b/modules/angular2/src/router/interfaces.ts @@ -23,14 +23,12 @@ var __ignore_me = global; * * ## Example * ``` - * import {Component, View} from 'angular2/angular2'; + * import {Component} from 'angular2/angular2'; * import {OnActivate, ComponentInstruction} from 'angular2/router'; * * @Component({ - * selector: 'my-cmp' - * }) - * @View({ - * template: '
        hello!
        ' + * selector: 'my-cmp', + * template: '
        hello!
        ' * }) * class MyCmp implements OnActivate { * onActivate(next: ComponentInstruction, prev: ComponentInstruction) { @@ -56,14 +54,12 @@ export interface OnActivate { * * ## Example * ``` - * import {Component, View} from 'angular2/angular2'; + * import {Component} from 'angular2/angular2'; * import {CanReuse, OnReuse, ComponentInstruction} from 'angular2/router'; * * @Component({ - * selector: 'my-cmp' - * }) - * @View({ - * template: '
        hello!
        ' + * selector: 'my-cmp', + * template: '
        hello!
        ' * }) * class MyCmp implements CanReuse, OnReuse { * canReuse(next: ComponentInstruction, prev: ComponentInstruction) { @@ -92,14 +88,12 @@ export interface OnReuse { * * ## Example * ``` - * import {Component, View} from 'angular2/angular2'; + * import {Component} from 'angular2/angular2'; * import {OnDeactivate, ComponentInstruction} from 'angular2/router'; * * @Component({ - * selector: 'my-cmp' - * }) - * @View({ - * template: '
        hello!
        ' + * selector: 'my-cmp', + * template: '
        hello!
        ' * }) * class MyCmp implements OnDeactivate { * onDeactivate(next: ComponentInstruction, prev: ComponentInstruction) { @@ -129,14 +123,12 @@ export interface OnDeactivate { * * ## Example * ``` - * import {Component, View} from 'angular2/angular2'; + * import {Component} from 'angular2/angular2'; * import {CanReuse, OnReuse, ComponentInstruction} from 'angular2/router'; * * @Component({ - * selector: 'my-cmp' - * }) - * @View({ - * template: '
        hello!
        ' + * selector: 'my-cmp', + * template: '
        hello!
        ' * }) * class MyCmp implements CanReuse, OnReuse { * canReuse(next: ComponentInstruction, prev: ComponentInstruction) { @@ -169,14 +161,12 @@ export interface CanReuse { * * ## Example * ``` - * import {Component, View} from 'angular2/angular2'; + * import {Component} from 'angular2/angular2'; * import {CanDeactivate, ComponentInstruction} from 'angular2/router'; * * @Component({ - * selector: 'my-cmp' - * }) - * @View({ - * template: '
        hello!
        ' + * selector: 'my-cmp', + * template: '
        hello!
        ' * }) * class MyCmp implements CanDeactivate { * canDeactivate(next: ComponentInstruction, prev: ComponentInstruction) { diff --git a/modules/angular2/src/router/lifecycle_annotations.ts b/modules/angular2/src/router/lifecycle_annotations.ts index 313a97d1af..ca43f6e9f4 100644 --- a/modules/angular2/src/router/lifecycle_annotations.ts +++ b/modules/angular2/src/router/lifecycle_annotations.ts @@ -39,10 +39,8 @@ export { * import {CanActivate} from 'angular2/router'; * * @Component({ - * selector: 'control-panel-cmp' - * }) - * @View({ - * template: '
        Control Panel: ...
        ' + * selector: 'control-panel-cmp', + * template: '
        Control Panel: ...
        ' * }) * @CanActivate(() => checkIfUserIsLoggedIn()) * class ControlPanelCmp { diff --git a/modules/angular2/src/router/location.ts b/modules/angular2/src/router/location.ts index 18ea970339..c640130183 100644 --- a/modules/angular2/src/router/location.ts +++ b/modules/angular2/src/router/location.ts @@ -16,11 +16,10 @@ import {OpaqueToken, Injectable, Optional, Inject} from 'angular2/src/core/di'; * ## Example * * ``` - * 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([ * {...}, * ]) @@ -56,7 +55,7 @@ export const APP_BASE_HREF: OpaqueToken = CONST_EXPR(new OpaqueToken('appBaseHre * ## Example * * ``` - * import {Component, View} from 'angular2/angular2'; + * import {Component} from 'angular2/angular2'; * import { * ROUTER_DIRECTIVES, * ROUTER_PROVIDERS, @@ -64,8 +63,7 @@ export const APP_BASE_HREF: OpaqueToken = CONST_EXPR(new OpaqueToken('appBaseHre * Location * } from 'angular2/router'; * - * @Component({...}) - * @View({directives: [ROUTER_DIRECTIVES]}) + * @Component({directives: [ROUTER_DIRECTIVES]}) * @RouteConfig([ * {...}, * ]) diff --git a/modules/angular2/src/router/path_location_strategy.ts b/modules/angular2/src/router/path_location_strategy.ts index f103a97f4a..a5f8e8b600 100644 --- a/modules/angular2/src/router/path_location_strategy.ts +++ b/modules/angular2/src/router/path_location_strategy.ts @@ -23,7 +23,7 @@ import {LocationStrategy} from './location_strategy'; * ## Example * * ``` - * import {Component, View, provide} from 'angular2/angular2'; + * import {Component, provide} from 'angular2/angular2'; * import { * APP_BASE_HREF * ROUTER_DIRECTIVES, @@ -32,8 +32,7 @@ import {LocationStrategy} from './location_strategy'; * Location * } from 'angular2/router'; * - * @Component({...}) - * @View({directives: [ROUTER_DIRECTIVES]}) + * @Component({directives: [ROUTER_DIRECTIVES]}) * @RouteConfig([ * {...}, * ])