Iv. ng-if, Ng-show, Ng-switch
Reference: Angularjs's learning--ng-show/ng-hide/ng-if and Ng-switch
Simple summary:
Ng-show and ng-hide simply show or hide the DOM nodes, and the nodes will still be loaded and rendered
Ng-if, like Ng-show, receives a bool, but when Ng-if is false, the DOM node it controls is not created or the previous DOM node is destroyed, which speeds up the DOM loading
Ng-switch omitted the Tab tab trouble, it listens to a variable, the variable value is a, a control of the DOM node will be created to display, the variable value is B, A's DOM node is destroyed, B's DOM node is created
Ng-switch is useless, here is a small example:
<script type= "Text/javascript" >var Democtrl = function ($scope) {$scope. Showmode = "a"; $scope. Changeshow = function (Showmode) {$scope. Showmode = Showmode;}}; </script>
Angular Sporadic knowledge point 2