mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-05 13:46:36 +08:00
58 lines
1.7 KiB
HTML
58 lines
1.7 KiB
HTML
<html ng-app="navTest">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Nav Bars</title>
|
|
|
|
<!-- Sets initial viewport load and disables zooming -->
|
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
<link href="/vendor/font-awesome/css/font-awesome.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
|
|
<script src="../../../../dist/js/ionic.js"></script>
|
|
<script src="../../../../dist/js/ionic-angular.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<navs>
|
|
<nav-bar type="bar-primary" back-button-type="button-pure">
|
|
</nav-bar>
|
|
|
|
<div ng-controller="AppCtrl">
|
|
<content has-header="true">
|
|
</content>
|
|
</div>
|
|
</navs>
|
|
|
|
<script id="page.html" type="text/ng-template">
|
|
<div title="Home home" ng-controller="CatsCtrl" class="nav-content">
|
|
<h1></h1>
|
|
<button class="button button-success" ng-click="goNext()">Next</button>
|
|
<list><list-item ng-repeat="item in items" on-select="goNext()">Test</list-item></list>
|
|
</div>
|
|
</script>
|
|
|
|
<script>
|
|
angular.module('navTest', ['ionic', 'ngAnimate'])
|
|
|
|
.controller('AppCtrl', function($scope) {
|
|
$scope.navController.pushFromTemplate('page.html');
|
|
})
|
|
|
|
.controller('CatsCtrl', function($scope, $compile, $element) {
|
|
|
|
|
|
$scope.$on('navContent.shown', function() {
|
|
console.log('SHOWN');
|
|
});
|
|
$scope.$on('navContent.hidden', function() {
|
|
console.log('HIDDEN');
|
|
});
|
|
|
|
$scope.goNext = function() {
|
|
$scope.navController.pushFromTemplate('page.html');
|
|
};
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|