Friday, 15 February 2013

AngularJS, display text for boolean value -



AngularJS, display text for boolean value -

i have next html ajs expect see is boss? : true, when person.isboss has boolean true.

<span>is boss? :</span> <span> {{ person.isboss }}</span>

but displayed just

is boss? :

how create ajs display "true" or "false" boolean values?

your code should work fine, have look:

class="snippet-code-js lang-js prettyprint-override">var myapp = angular.module('myapp', []); function myctrl($scope) { $scope.person = { isboss: true }; } class="snippet-code-html lang-html prettyprint-override"><body ng-app> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <div ng-controller="myctrl"> <span>is boss? :</span> <span> {{ person.isboss }}</span> </div> </body>

angularjs

No comments:

Post a Comment