In the previous chapters, we have learned how to install and create an angular application. Now, let’s discuss the Angular framework building blocks.
Angular Metadata
The metadata informs Angular how to handle the component class. To teach Angular, just use the decorator to connect your information to your Typescript. The decorators are the most important elements to understand while working with angular.
The metadata allows the user to specify the AppComponent, as seen in the sample below:
Angular Services
You construct a service class to store data or logic that isn't particular to a view and that you wish to share across components.
The @Injectable decorator is used just before the service class declaration. The decorator creates the metadata necessary for your service to be injected as a dependency into client components.
To improve modularity and reusability, Angular isolates components from services. You may keep your component classes short and efficient by isolating view-related functionality from other types of processing.
Angular Dependency Injection
You can guarantee that your component classes are efficient and lean by using Dependency Injection. This is because dependency injection will transmit duties to the servers such as getting data from the server and verifying form activity.
Dependency injection is linked to the Angular framework and is utilized in the supply of new components with all the servers and their requirements. The angular components are used to receive services via an injection procedure, granting access to the server class