Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aaccurso/10514774 to your computer and use it in GitHub Desktop.
Save aaccurso/10514774 to your computer and use it in GitHub Desktop.
A Pen by Justin Noel.
<html ng-app="ionicApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Ionic Template</title>
<link href="http://code.ionicframework.com/1.0.0-beta.1/css/ionic.css" rel="stylesheet">
<script src="http://code.ionicframework.com/1.0.0-beta.1/js/ionic.bundle.js"></script>
</head>
<body>
<ion-nav-bar class="bar-positive nav-title-slide-ios7" align-title="center">
<ion-nav-back-button class="button-icon ion-arrow-left-c">
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view class="slide-left-right"></ion-nav-view>
<script id="page1.html" type="text/ng-template">
<!-- The title of the ion-view will be shown on the navbar -->
<ion-view title="Page 1" hide-back-button="true">
<ion-content class="padding">
<!-- The content of the page -->
<a class="button" ui-sref="page2">Go To Page 2</a>
</ion-content>
</ion-view>
</script>
<script id="page2.html" type="text/ng-template">
<!-- The title of the ion-view will be shown on the navbar -->
<ion-view title="Page 2">
<ion-nav-buttons side="left">
<button class="button">
LeftButton!
</button>
</ion-nav-buttons>
<ion-nav-buttons side="right">
<button class="button">
RightButton!
</button>
</ion-nav-buttons>
<ion-content class="padding">
<!-- The content of the page -->
<a class="button" ui-sref="page1">Go To Page 1</a>
<a class="button" ui-sref="page3">Go To Page 3</a>
</ion-content>
</ion-view>
</script>
<script id="page3.html" type="text/ng-template">
<!-- The title of the ion-view will be shown on the navbar -->
<ion-view title="Page 3">
<ion-content class="padding">
<!-- The content of the page -->
<a class="button" ui-sref="page1">Go To Page 1</a>
<a class="button" ui-sref="page2">Go To Page 2</a>
</ion-content>
</ion-view>
</script>
</body>
</html>
angular.module('ionicApp', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('page1', {
url: '/1',
templateUrl: 'page1.html'
})
.state('page2', {
url: '/2',
templateUrl: 'page2.html'
})
.state('page3', {
url: '/3',
templateUrl: 'page3.html',
controller : "Page3Ctrl"
})
$urlRouterProvider.otherwise("/1");
})
.controller('Page3Ctrl', function($scope) {
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment