Following is sample to help you know how to use ng-true-value and ng-false-value in input via checkbox type.
<html>
<head>
<title> </title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script>
<style>
.ng-invalid {
color: red;
}
td {
padding-right: 30px;
}
</style>
<script>
angular.module('myapp', [])
.controller('ExampleController', ['$scope', function ($scope) {
$scope.game = 'NO';
$scope.tour = 'YES';
}]);
</script>
</head>
<body ng-app="MyForm"
<form name="calForm" ng-controller="ExampleController" ng-submit=" DoAction()">
<br /
Play game: <input type="checkbox" ng-model="game"
ng-true-value="'YES'" ng-false-value="'NO'" />
<br />
Tour: <input type="checkbox" ng-model="tour" ng-true-value="'YES'"
ng-false-value="'NO'" />
<br />
<h4>you are choosing</h4>
<tt>Play game = {{game}}</tt><br />
<tt>Tour = {{tour}}</tt><br />
</form>
</body>
</html>
ng true value thanks for it. so we can convert string to number javascript jquery
ReplyDeleteConvert String to Integer using jQuery
jquery convert string to decimal
jquery convert string to double
javascript string to decimal
javascript string to number
how to convert number to string
parseint jquery val
Jquery convert String to Integer
Convert String to Integer in jQuery javascript
I like your post very much. It is very much useful for my research. I hope you to share more info about this. Keep posting angularjs online training
ReplyDelete