2015-11-06 07:26:24 -05:00
|
|
|
@cheatsheetSection
|
|
|
|
Class decorators
|
2015-11-13 02:14:12 -05:00
|
|
|
@cheatsheetIndex 4
|
2015-11-05 10:04:55 -05:00
|
|
|
@description
|
|
|
|
`import {Directive, ...} from 'angular2/angular2';`
|
|
|
|
|
|
|
|
@cheatsheetItem
|
2015-12-09 07:33:42 -05:00
|
|
|
syntax:
|
2015-11-05 10:04:55 -05:00
|
|
|
`@Component({...})
|
|
|
|
class MyComponent() {}`|`@Component({...})`
|
2015-12-09 07:33:42 -05:00
|
|
|
description:
|
2015-11-05 10:04:55 -05:00
|
|
|
Declares that a class is a component and provides metadata about the component.
|
|
|
|
|
|
|
|
@cheatsheetItem
|
2015-12-09 07:33:42 -05:00
|
|
|
syntax:
|
2015-11-05 10:04:55 -05:00
|
|
|
`@Pipe({...})
|
|
|
|
class MyPipe() {}`|`@Pipe({...})`
|
2015-12-09 07:33:42 -05:00
|
|
|
description:
|
2015-11-05 10:04:55 -05:00
|
|
|
Declares that a class is a pipe and provides metadata about the pipe.
|
|
|
|
|
|
|
|
@cheatsheetItem
|
2015-12-09 07:33:42 -05:00
|
|
|
syntax:
|
2015-11-05 10:04:55 -05:00
|
|
|
`@Injectable()
|
|
|
|
class MyService() {}`|`@Injectable()`
|
2015-12-09 07:33:42 -05:00
|
|
|
description:
|
2015-11-05 10:04:55 -05:00
|
|
|
Declares that a class has dependencies that should be injected into the constructor when the dependency
|
|
|
|
injector is creating an instance of this class.
|