-1

I want to hide button on specific action. For example when i show the Organization units record I want to hide locate button. Which is in the table grid.

Grid is showing the records of cities and organization units. I don't want a locate button to show when viewing organization units.

    $scope.showOrganizationunit=function(){

     show organization unit data 

      Hide button ( how to do it)
      can we use nghide here for the button



}
imadfooki fooki
  • 177
  • 2
  • 2
  • 8
  • What have you tried ? There are plenty of solutions available for this question. Refer this: http://stackoverflow.com/questions/12599637/angularjs-ng-show-ng-hide – Rayon Dec 07 '15 at 09:13

1 Answers1

1

You should add the HTML code, I will give you a generic sample:

HTML:

<button ng-show="organization" ng-click="showOrganizationunit()">Click me</button>

JS:

$scope.organization = true;
$scope.showOrganizationunit=function() {
   $scope.organization = false;
}

Another way much simpler is to define the scoped variable directly in the HTML, in this way you don't need any controller:

<button ng-show="organization" ng-click="organization = (organization) ? false : true">Click me</button>

JSFiddle

michelem
  • 14,430
  • 5
  • 50
  • 66