Why using ng-show could trigger an error?


#1

Html code is below

<div class="button-bar" ng-show="true">
     <div class="button button-outline button-energized" >
     Edit
      </div>
</div

error is:

 Uncaught TypeError: object is not a function  angular-animate.js:992

I think this code could be executed in web app without error. Cannot understand where is the mistake in the code. If this is because of ionic, is there any approach to fix the error? or just ignore it?


#2

In this case “true” is a variable or a fonction (where the name is true) not the value true, I think you did not declared in javascript.


#3

it is searching for a value that you defined on your scope, if you do it in the controller it would be:

$scope.true = true;

Basically, ng-show searches for an attribute on your scope, so using “true” will not validate as a boolean, but is searching for the attribute “true” on the scope.


#4

after I run ‘bower update angular’ (even the new version is same as the preview one), the issue fixed.
ng-show=“true” works fine.
So I think “true” is acceptable.