Angular10 NgSwitch Directive
In this article, we are going to see what is NgSwitch in Angular 10 and how to use it.
The NgSwitch in Angular10 is used to specify the condition to show or hide the child elements.
NgModule: Module used by NgSwitch is:
- Create the angular app to be used
- There is no need for any import for the NgSwitch to be used
- define a variable in app.component.ts
- in app.component.html use NgSwitch with NgSwitchCase directive in the element with conditions to be checked
- Serve the angular app using ng serve to see the output