ng Flashcards
what is ngFor?
NgFor is a structural directive in Angular used for rendering lists of items. It iterates over an array or an object and creates a template for each item in the collection. It is commonly used to display dynamic lists in Angular templates.
What is ngClass?
ngClass is a directive in Angular used to dynamically add or remove CSS classes to HTML elements. It allows you to conditionally apply styles based on certain conditions in your component. This directive is useful for dynamically changing the appearance of elements.
What is NgStyle?
ngStyle is another Angular directive used to dynamically set CSS styles on an HTML element. It allows you to apply inline styles based on expressions in the component. With ngStyle, you can dynamically change the appearance of elements based on component logic.
What is NgIf?
ngIf is a structural directive in Angular used for conditionally rendering elements in the DOM. It evaluates an expression and only renders the associated template if the expression is true. This directive is handy for showing or hiding elements based on certain conditions in your application