What is the Component Decorator in Angular?
Whenever you want to make a class as a component, then you need to decorate that class with @Component decorator.
Properties of Component Decorator:
- changeDetection – change the detection strategy used by this component.
- templateUrl – URL in an external file that contains a template for the view.
- template – template defined inline template for the view.
- viewProviders – list of providers available for this component and the view of their children.
- animations – animation’s list of this component.
- moduleId – Module ID ES / CommonJS of the file in which this component is defined.
- encapsulation – strategy of style encapsulation used by this component.
- styleUrls – URL list for style sheets that will be applied to the view of this component.
- interpolation – custom interpolation markers used in the template of this component.
- styles – styles defined online that will be applied to the view of this component.
- preserveWhitespaces – Using this property, we can remove all whitespaces from the template.
- entryComponents – entry Components is the list of components that are dynamically inserted into the view of this component.
No comments:
Post a Comment
Thank you for visiting my blog