mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-05 21:58:20 +08:00
45 lines
1.5 KiB
HTML
45 lines
1.5 KiB
HTML
<html ng-app="navTest">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Checkbox</title>
|
|
|
|
<!-- Sets initial viewport load and disables zooming -->
|
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
|
|
</head>
|
|
<body>
|
|
|
|
<div ng-controller="TestCtrl">
|
|
<content has-header="true" class="reveal-animation">
|
|
<p><checkbox ng-model="data.isLovely"></checkbox></p>
|
|
<button type="submit" class="button button-danger" ng-click="setToTrue()">Set to true</button>
|
|
<button type="submit" class="button button-danger" ng-click="setToFalse()">Set to false</button>
|
|
<button type="submit" class="button button-danger" ng-click="getValue()">Get Value</button>
|
|
</content>
|
|
</div>
|
|
|
|
<script src="../../../../dist/js/ionic.js"></script>
|
|
<script src="../../../../dist/js/ionic-angular.js"></script>
|
|
<script>
|
|
angular.module('navTest', ['ionic.ui.checkbox', 'ionic.ui.content', 'ngAnimate', 'ngTouch'])
|
|
|
|
.controller('TestCtrl', function($scope) {
|
|
$scope.data = {};
|
|
$scope.getValue = function() {
|
|
console.log('Get Value', $scope.data);
|
|
}
|
|
$scope.setToTrue = function() {
|
|
$scope.data.isLovely = true;
|
|
return false;
|
|
}
|
|
$scope.setToFalse = function() {
|
|
$scope.data.isLovely = false;
|
|
return false;
|
|
}
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|