0 votes
in Angular by
When do we use a directive in Angular?

1 Answer

0 votes
by

If you create an Angular application where multiple components need to have similar functionalities, you have to do it by adding this functionality individually to every component. This is not a very easy task. Directives are used to cope up with this situation. Here, we can create a directive with the required functionality and then import the directive to components that require this functionality.

Related questions

0 votes
0 votes
asked Dec 13, 2020 in Angular by SakshiSharma
0 votes
asked Feb 5, 2021 in Angular by SakshiSharma
...