Sunday, October 15, 2023

Angular Component Decorator

 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:
  1. changeDetection – change the detection strategy used by this component.
  2. templateUrl – URL in an external file that contains a template for the view.
  3. template – template defined inline template for the view.
  4. viewProviders – list of providers available for this component and the view of their children.
  5. animations – animation’s list of this component.
  6. moduleId – Module ID ES / CommonJS of the file in which this component is defined.
  7. encapsulation – strategy of style encapsulation used by this component.
  8. styleUrls – URL list for style sheets that will be applied to the view of this component.
  9. interpolation – custom interpolation markers used in the template of this component.
  10. styles – styles defined online that will be applied to the view of this component.
  11. preserveWhitespaces – Using this property, we can remove all whitespaces from the template.
  12. 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

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...