angular-cn/modules/@angular/docs/cheatsheet/component-configuration.md
Kathy Walrath d59ee3caaa docs(cheatsheet): copy edit component-configuration.md (#11155)
Also remove Dart-specific code, since the Dart cheatsheet is produced
from dart-lang/angular2.

Part of a group of cheatsheet PRs (see #11149).

cc @Foxandxss & @IgorMinar
2016-08-29 18:12:51 -07:00

1.1 KiB
Raw Blame History

@cheatsheetSection Component configuration @cheatsheetIndex 7 @description {@target js}ng.core.Component extends ng.core.Directive, so the ng.core.Directive configuration applies to components as well{@endtarget} {@target ts}@Component extends @Directive, so the @Directive configuration applies to components as well{@endtarget}

@cheatsheetItem syntax: moduleId: module.id|moduleId: description: If set, the templateUrl and styleUrl are resolved relative to the component.

@cheatsheetItem syntax(ts): viewProviders: [MyService, { provide: ... }]|viewProviders: syntax(js): viewProviders: [MyService, { provide: ... }]|viewProviders: description: Array of dependency injection providers scoped to this component's view.

@cheatsheetItem syntax: template: 'Hello {{name}}' templateUrl: 'my-component.html'|template:|templateUrl: description: Inline template or external template URL of the component's view.

@cheatsheetItem syntax: styles: ['.primary {color: red}'] styleUrls: ['my-component.css']|styles:|styleUrls: description: List of inline CSS styles or external stylesheet URLs for styling the components view.