Directives in Ionic.pptx
Document Details
Full Transcript
Directives in Ionic Structural Directive Ngif Ngfor NgSwitch Attribute Directive ngClass NgStyle NgIf When we want to display something based on some condition that time we used ngIf. For example : If I want to display image on button click that time I can use ngIf ngif ngSwitch This is s...
Directives in Ionic Structural Directive Ngif Ngfor NgSwitch Attribute Directive ngClass NgStyle NgIf When we want to display something based on some condition that time we used ngIf. For example : If I want to display image on button click that time I can use ngIf ngif ngSwitch This is similar to switch statement in Programming language. ngSwitch Inside your Component.ts file you need to specify the variable name ngSwitch ngFor The *ngFor directive in Angular is used to loop over a collection of items, such as an array or a list, and generate HTML elements for each item in the collection. It's similar to a "for-each" loop in other programming languages. output