Components, services, and dependency injection

Normally, you write Angular applications by composing HTML templates with the Angular-specific markup and component classes to manage those templates. A component is simply a TypeScript class annotated with @Component. The @Component decorator is used to define the associated metadata. It expects an object with the following most used properties:

  • selector: This is the name of the HTML tag representing this component
  • template: This is an inline-defined template with HTML/Angular markup for the view
  • templateUrl: This is the path to an external file where the template resides
  • styles: An inline-defined styles to be applied to this component's view
  • styleUrls: An array of paths to external files with ...

Get Angular UI Development with PrimeNG now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.