Category: Directives
-
Use of *ngIf directive to change the output conditionally
Example: component.ts file: component.html file: Output: The output will look like this. When we change the input value and click on “Add Server” button, you will see the following result: You can see in the above example that by using *ngIf directive, we can change the condition to display the output accordingly. You can check…
-
Angular 7 Directives
Directives are instructions in the DOM. They specify how to place your components and business logic in the Angular. Directives are js class and declared as @directive. There are 3 directives in Angular. Component Directives: Component directives are used in main class. They contain the detail of how the component should be processed, instantiated and used…