ngFor, ngIf, ngSwitch :- structural or
ngClass, ngStyle :- attribute
What are the things that we can't do with the above mentioned directive? And there will be a real need of custom directive?
ngFor, ngIf, ngSwitch :- structural or
ngClass, ngStyle :- attribute
What are the things that we can't do with the above mentioned directive? And there will be a real need of custom directive?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Aug 23, 2021, 6:02 AM
Dinesh DPosted Aug 23, 2021, 5:38 AM
We can use attribute directives to change the style of DOM elements. These are the directives also used to hide or show particular DOM elements conditionally. Angular provides many built-in Attribute Directives like NgStyle, NgClass, etc. We can also create our own custom Attribute Directives for our desired functionality
https://angular.io/guide/built-in-directives