chore(core): remove @View annotation

Closes #7495
This commit is contained in:
Brian Ford
2016-03-08 13:36:48 -08:00
parent 095db673c5
commit f9fb72fb0e
85 changed files with 588 additions and 599 deletions

View File

@ -45,7 +45,7 @@ export class ViewResolver {
if (isPresent(compMeta)) {
if (isBlank(compMeta.template) && isBlank(compMeta.templateUrl) && isBlank(viewMeta)) {
throw new BaseException(
`Component '${stringify(component)}' must have either 'template', 'templateUrl', or '@View' set.`);
`Component '${stringify(component)}' must have either 'template' or 'templateUrl' set.`);
} else if (isPresent(compMeta.template) && isPresent(viewMeta)) {
this._throwMixingViewAndComponent("template", component);
@ -84,7 +84,8 @@ export class ViewResolver {
}
} else {
if (isBlank(viewMeta)) {
throw new BaseException(`No View decorator found on component '${stringify(component)}'`);
throw new BaseException(
`Could not compile '${stringify(component)}' because it is not a component.`);
} else {
return viewMeta;
}

View File

@ -254,7 +254,6 @@ export interface ComponentFactory {
* import {Component, View} from "angular2/core";
*
* @Component({...})
* @View({...})
* class MyComponent {
* constructor() {
* ...
@ -481,8 +480,7 @@ export interface HostListenerFactory {
/**
* Declare reusable UI building blocks for an application.
*
* Each Angular component requires a single `@Component` and at least one `@View` annotation. The
* `@Component`
* Each Angular component requires a single `@Component` annotation. The `@Component`
* annotation specifies when a component is instantiated, and which properties and hostListeners it
* binds to.
*
@ -493,8 +491,6 @@ export interface HostListenerFactory {
*
* All template expressions and statements are then evaluated against the component instance.
*
* For details on the `@View` annotation, see {@link ViewMetadata}.
*
* ## Lifecycle hooks
*
* When the component class implements some {@link angular2/lifecycle_hooks} the callbacks are
@ -918,8 +914,7 @@ export var Directive: DirectiveFactory = <DirectiveFactory>makeDecorator(Directi
* }
* ```
*/
export var View: ViewFactory =
<ViewFactory>makeDecorator(ViewMetadata, (fn: any) => fn.View = View);
var View: ViewFactory = <ViewFactory>makeDecorator(ViewMetadata, (fn: any) => fn.View = View);
/**
* Specifies that a constant attribute value should be injected.
@ -1154,8 +1149,8 @@ export var ViewChild: ViewChildFactory = makePropDecorator(ViewChildMetadata);
* ### Example ([live demo](http://plnkr.co/edit/eNsFHDf7YjyM6IzKxM1j?p=preview))
*
* ```javascript
* @Component({...})
* @View({
* @Component({
* ...,
* template: `
* <item> a </item>
* <item> b </item>

View File

@ -242,8 +242,8 @@ export class ContentChildMetadata extends QueryMetadata {
* ### Example ([live demo](http://plnkr.co/edit/eNsFHDf7YjyM6IzKxM1j?p=preview))
*
* ```javascript
* @Component({...})
* @View({
* @Component({
* ...,
* template: `
* <item> a </item>
* <item> b </item>