TypeDecorator
interface
npm Package | @angular/core |
---|---|
Module | import { TypeDecorator } from '@angular/core'; |
Source | core/src/util/decorators.ts |
Interface Overview
interface TypeDecorator { <T extends Type<any>>(type: T): T annotations: any[] Class(obj: ClassDefinition): Type<any> }
Description
An interface implemented by all Angular type decorators, which allows them to be used as ES7 decorators as well as Angular DSL syntax.
DSL syntax:
var MyClass = ng .Component({...}) .Class({...});
ES7 syntax:
@ng.Component({...}) class MyClass {...}
Members
<T extends Type<any>>(type: T): T
Invoke as ES7 decorator.
Overloads
(target: Object, propertyKey?: string|symbol, parameterIndex?: number): void
annotations: any[]
Storage for the accumulated annotations so far used by the DSL syntax.
Used by Class
to annotate the generated class.
Class(obj: ClassDefinition): Type<any>
Generate a class from the definition and annotate it with TypeDecorator
.
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v4.angular.io/api/core/TypeDecorator