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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Aug 23, 2021, 2:02 AM EDT
Dinesh DRank #5,346 · 302 reputationPosted Aug 23, 2021, 1:38 AM EDT
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