ptutorial - angularjs switch case with example or ng-switch example with running example, angularjs conditional statements with example. ptutorial - angularjs switch case with example or ng-switch example with running example, angularjs conditional statements with example. Definition and Usage. The ng-switch directive lets you hide/show HTML elements depending on an expression.. Child elements with the ng-switch-when directive will be displayed if it gets a match, otherwise the element, and its children will be removed.. You can also define a default section, by using the ng-switch-default directive, to show a section if none of the other sections get a match. Nov 16, · On this page we will provide angular 2 NgSwitch example. NgSwitch is an angular directive that displays one element from a possible set of elements based on some condition. NgSwitch uses ngSwitchCase and ngSwitchDefault.