Practice ng-show and ng-hide methods and ng-showng-hide
In the program design process, we need to display and hide an element or a piece.
If you are using angularjs, you can use ng-show or ng-hide for control.
Var showhideApp = angular. module ('showhideapp', []); Source Code
Define the controller. Write the following two buttons:
ShowhideApp. controller ('showhidecontroller', function ($ scope) {$ scope. isVisibled = false; $ scope. showDivTag = function () {$ scope. isVisibled = true;} $ scope. hideDivTag = function () {$ scope. isVisibled = false ;}}); Source Code
Html code:
<Div ng-app = "showhideApp" ng-controller = "showhideController"> <div> <input type = "button" value = "ShowDivTag" ng-click = "ShowDivTag () "/> <input type =" button "value =" HideDivTag "ng-click =" HideDivTag () "/> </div> <div ng-show =" IsVisibled "> Insus. NET </div> Source Code
Preview: