angular-cn/modules/@angular/docs/cheatsheet/directive-configuration.md

24 lines
761 B
Markdown
Raw Normal View History

2015-11-06 07:26:24 -05:00
@cheatsheetSection
Directive configuration
@cheatsheetIndex 6
2015-11-06 07:26:24 -05:00
@description
{@target ts}`@Directive({ property1: value1, ... })`{@endtarget}
{@target js}`ng.core.Directive({ property1: value1, ... }).Class({...})`{@endtarget}
2015-11-05 10:04:55 -05:00
@cheatsheetItem
syntax:
2015-11-05 10:04:55 -05:00
`selector: '.cool-button:not(a)'`|`selector:`
description:
Specifies a CSS selector that identifies this directive within a template. Supported selectors include `element`,
2015-11-05 10:04:55 -05:00
`[attribute]`, `.class`, and `:not()`.
Does not support parent-child relationship selectors.
@cheatsheetItem
syntax(ts):
`providers: [MyService, { provide: ... }]`|`providers:`
syntax(js):
`providers: [MyService, { provide: ... }]`|`providers:`
description:
List of dependency injection providers for this directive and its children.