🗃️ Structural Directives
4 items
📄️ ngClass
ngClass is a built-in directive in Angular that allows you to dynamically add or remove CSS classes to an HTML element based on an expression. This directive is particularly useful for changing the appearance of elements in response to component state or user interactions.
📄️ ngStyle
ngStyle is a built-in directive in Angular that allows you to set inline styles dynamically on an HTML element based on a given condition or expression. This directive is particularly useful for changing the style of an element in response to component state changes, user interactions, or other dynamic conditions in your application.
📄️ ngContainer
ng-container is a special Angular element that acts as a grouping element for structural directives but doesn't interfere with styles or layout because Angular doesn't put it in the DOM. This element is particularly useful for cases where you want to apply a structural directive (like ngIf, ngFor, ngSwitch) but don't want to add an extra element to the DOM, which might disrupt your layout or styling.
📄️ ng-content
`` in Angular is a special directive used in component templates to create a content projection spot. It allows you to compose complex components by including content from outside the component. This feature is particularly useful for creating reusable and customizable components.