1

my json responce is {isVimeo = true } in angular js

<div ng-show={{isVimeo}}>
    ----
    ----
    ------
</div>

I want to show this div when isVimeo is true,but it is not display at my html.when i click inspect element in my html page the following code is there

<div ng-show="true" class="ng-hide">

</div>

when i remove the ng-hide class in inspect element it is displaying.By default it is not displayong

Can anyone help!

Thanks!

Srikanth
  • 37
  • 9
  • 2
    You do not need the `{{}}` brackets in ng-show. Just wrige `ng-show="isVimeo"` – WeSt Dec 09 '14 at 14:30
  • 2
    possible duplicate of [AngularJs: ng-show / ng-hide](http://stackoverflow.com/questions/12599637/angularjs-ng-show-ng-hide) – Ivan Chernykh Dec 09 '14 at 14:33

2 Answers2

3
<div ng-show="isVimeo">

And be sure $scope.isVimeo is set to true in the current scope.

enguerranws
  • 8,087
  • 8
  • 49
  • 97
0

angular.module('testApp',[]).controller('testCTRL',function($scope)
                               
{
  $scope.wantToShow = true;
  $scope.dontShow = false;
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>

<head>ng-show example:</head>
<body data-ng-app="testApp">
    <div data-ng-controller="testCTRL">
      
      <br>
      
      <b>ng-show is true:</b> 
      <span data-ng-show="wantToShow"> It is showing this becuase ng-show is true</span>
      
      <br><br>
      
      <b>ng-show is false(So,nothing we are showing):</b>
      
      <p data-ng-show="dontShow">It is showing this becuase ng-show is true</p>
      
    </div>
</body>
ramanathan
  • 104
  • 1
  • 2