I am new to Angularjs and practicing it by doing some tasks. Here I am creating an object in controller and the object values in my web page. But here the ng-show does not evaluate the below expression. But if I create a variable in controller as $scope.ngshow = false; it will work. Please help me why the below code did not worked.
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<ul>
<li ng-show = "a.name"> Name {{a.name}} </li>
<li ng-show = "a.id"> Id {{a.id}}</li>
<li ng-show = "a.address"> Address {{a.address}}</li>
</ul>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.a = {
'name' : 'false',
'id' : 'true',
'address' : 'false'
};
});
</script>
<p>ng-show didnt accept expressions.</p>
</body>
</html>
Thanks for your valuable time.