How to use ng-Show in directive ?
An ng-Show directive is a block or session of DOM presenting or hide the functional ng-Show attribute value base. If ng-Show directive value have false means that DOM block is not appear, The directive value have true means That DOM block is appear.
Example HTML:
<div ng-app="ShowModule">
<div ng-controller="ShowContoller">
<div ng-show="flag" class="myStyle">
welcome to the India
</div>
<button ng-click="show()">Show</button>
<button ng-click="hide()">Hide</button>
</div>
</div>
Javascript :
var app = angular.module("ShowModule",[]);
app.controller("ShowContoller", function($scope){
$scope.flag = false;
$scope.show = function() {
$scope.flag = true;
}
$scope.hide = function() {
$scope.flag = false;
}
});
Comments
Post a Comment