mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Initial working version of router based nav controller
This commit is contained in:
119
js/ext/angular/test/navRouter.html
Normal file
119
js/ext/angular/test/navRouter.html
Normal file
@@ -0,0 +1,119 @@
|
||||
<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>
|
||||
<style>
|
||||
.view-animate > .ng-enter, .view-animate > .ng-leave {
|
||||
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms;
|
||||
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms;
|
||||
|
||||
display:block;
|
||||
width:100%;
|
||||
border-left:1px solid black;
|
||||
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
.view-animate > .ng-enter {
|
||||
-webkit-transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
.view-animate > .ng-enter.ng-enter-active {
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
}
|
||||
.view-animate > .ng-leave.ng-leave-active {
|
||||
-webkit-transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
.view-animate-reverse > .ng-enter, .view-animate-reverse > .ng-leave {
|
||||
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms;
|
||||
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 250ms;
|
||||
|
||||
display:block;
|
||||
width:100%;
|
||||
border-left:1px solid black;
|
||||
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
.view-animate-reverse > .ng-enter {
|
||||
-webkit-transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
.view-animate-reverse > .ng-enter.ng-enter-active {
|
||||
-webkit-transform: translate3d(0%, 0, 0);
|
||||
}
|
||||
.view-animate-reverse > .ng-leave.ng-leave-active {
|
||||
-webkit-transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<pane nav-router animation="view-animate">
|
||||
<ng-view></ng-view>
|
||||
</pane>
|
||||
|
||||
<script id="page1.html" type="text/ng-template">
|
||||
<pane>
|
||||
<h1>Page 1</h1>
|
||||
<a class="button button-pure" nav-back>Back</a>
|
||||
<a class="button button-assertive" href="#/page2">Next</a>
|
||||
</pane>
|
||||
</script>
|
||||
<script id="page2.html" type="text/ng-template">
|
||||
<pane>
|
||||
<h1>Page 2</h1>
|
||||
<a class="button button-pure" nav-back>Back</a>
|
||||
<a class="button button-assertive" href="#/page3">Next</a>
|
||||
</pane>
|
||||
</script>
|
||||
<script id="page3.html" type="text/ng-template">
|
||||
<pane>
|
||||
<h1>Page 3</h1>
|
||||
<a class="button button-pure" nav-back>Back</a>
|
||||
</pane>
|
||||
</script>
|
||||
<script>
|
||||
angular.module('navTest', ['ionic'])
|
||||
|
||||
|
||||
.config(function($routeProvider, $locationProvider) {
|
||||
$routeProvider.when('/page1', {
|
||||
templateUrl: 'page1.html',
|
||||
});
|
||||
|
||||
$routeProvider.when('/page2', {
|
||||
templateUrl: 'page2.html',
|
||||
});
|
||||
|
||||
$routeProvider.when('/page3', {
|
||||
templateUrl: 'page3.html',
|
||||
});
|
||||
$routeProvider.otherwise({
|
||||
redirectTo: '/page1'
|
||||
});
|
||||
|
||||
// configure html5 to get links working on jsfiddle
|
||||
//$locationProvider.html5Mode(true);
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user