mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 14:19:17 +08:00
39 lines
1.2 KiB
HTML
39 lines
1.2 KiB
HTML
<html ng-app="navTest">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Toggle</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>
|
|
|
|
<content has-header="true" ng-controller="TestCtrl" class="reveal-animation">
|
|
<form>
|
|
<toggle ng-model="data.isLovely"></toggle>
|
|
<button ng-click="toggle()" class="button button-danger">Toggle</button>
|
|
<button ng-click="doIt()" class="button button-warning">Print</button>
|
|
</form>
|
|
</content>
|
|
|
|
<script src="../../../../dist/js/ionic.js"></script>
|
|
<script src="../../../../dist/js/ionic-angular.js"></script>
|
|
<script>
|
|
angular.module('navTest', ['ionic.ui.toggle', 'ngAnimate', 'ngTouch'])
|
|
|
|
.controller('TestCtrl', function($scope) {
|
|
$scope.data = {};
|
|
$scope.doIt = function() {
|
|
console.log('DOIT', $scope.data);
|
|
}
|
|
$scope.toggle = function() {
|
|
$scope.data.isLovely = !$scope.data.isLovely;
|
|
};
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|