2015-11-06 07:26:24 -05:00
|
|
|
|
@cheatsheetSection
|
|
|
|
|
Component configuration
|
2015-11-13 02:14:12 -05:00
|
|
|
|
@cheatsheetIndex 6
|
2015-11-05 10:04:55 -05:00
|
|
|
|
@description
|
2015-12-12 22:17:26 -05:00
|
|
|
|
{@target js}`ng.core.Component` extends `ng.core.Directive`,
|
|
|
|
|
so the `ng.core.Directive` configuration applies to components as well{@endtarget}
|
|
|
|
|
{@target ts dart}`@Component` extends `@Directive`,
|
|
|
|
|
so the `@Directive` configuration applies to components as well{@endtarget}
|
2015-11-05 10:04:55 -05:00
|
|
|
|
|
|
|
|
|
@cheatsheetItem
|
2015-12-12 22:17:26 -05:00
|
|
|
|
syntax(ts dart):
|
2015-11-05 10:04:55 -05:00
|
|
|
|
`viewProviders: [MyService, provide(...)]`|`viewProviders:`
|
2015-12-12 22:17:26 -05:00
|
|
|
|
syntax(js):
|
|
|
|
|
`viewProviders: [MyService, ng.core.provide(...)]`|`viewProviders:`
|
2015-12-09 07:33:42 -05:00
|
|
|
|
description:
|
2015-11-05 10:04:55 -05:00
|
|
|
|
Array of dependency injection providers scoped to this component's view.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cheatsheetItem
|
2015-12-09 07:33:42 -05:00
|
|
|
|
syntax:
|
2015-11-06 07:26:24 -05:00
|
|
|
|
`template: 'Hello {{name}}'
|
|
|
|
|
templateUrl: 'my-component.html'`|`template:`|`templateUrl:`
|
2015-12-09 07:33:42 -05:00
|
|
|
|
description:
|
2015-12-10 12:52:19 -05:00
|
|
|
|
Inline template / external template URL of the component's view.
|
2015-11-05 10:04:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cheatsheetItem
|
2015-12-09 07:33:42 -05:00
|
|
|
|
syntax:
|
2015-11-06 07:26:24 -05:00
|
|
|
|
`styles: ['.primary {color: red}']
|
|
|
|
|
styleUrls: ['my-component.css']`|`styles:`|`styleUrls:`
|
2015-12-09 07:33:42 -05:00
|
|
|
|
description:
|
2015-12-10 12:52:19 -05:00
|
|
|
|
List of inline CSS styles / external stylesheet URLs for styling component’s view.
|
2015-11-05 10:04:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cheatsheetItem
|
2015-12-09 07:33:42 -05:00
|
|
|
|
syntax:
|
2015-11-05 10:04:55 -05:00
|
|
|
|
`directives: [MyDirective, MyComponent]`|`directives:`
|
2015-12-09 07:33:42 -05:00
|
|
|
|
description:
|
2015-11-05 10:04:55 -05:00
|
|
|
|
List of directives used in the the component’s template.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cheatsheetItem
|
2015-12-09 07:33:42 -05:00
|
|
|
|
syntax:
|
2015-11-05 10:04:55 -05:00
|
|
|
|
`pipes: [MyPipe, OtherPipe]`|`pipes:`
|
2015-12-09 07:33:42 -05:00
|
|
|
|
description:
|
2015-12-10 12:52:19 -05:00
|
|
|
|
List of pipes used in the component's template.
|