Skip to content

Instantly share code, notes, and snippets.

@jlstr
Last active August 29, 2015 14:05
Show Gist options
  • Save jlstr/beb15299b8fa74a43bfd to your computer and use it in GitHub Desktop.
Save jlstr/beb15299b8fa74a43bfd to your computer and use it in GitHub Desktop.
(function() {
var app = angular.module('starter', ['ionic', 'controllers', 'ngStorage']);
app.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
});
app.config(['$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {
//Default state
$urlRouterProvider.otherwise('home');
$stateProvider
//Home initial state
.state('home', {
url: '',
templateUrl: 'templates/home.html'
});
}
]);
})();
(function() {
var app = angular.module('controllers', []);
app.controller('ApplicationController', ['$scope', '$localStorage',
function($scope, $localStorage) {
$scope.$storage = $localStorage;
$scope.$storage.name = 'Jose'
}
]);
})();
<h3>We're home!</h3>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ngstorage/ngStorage.min.js"></script>
<script src="js/controllers/controllers.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
</head>
<body ng-app="starter" ng-controller="ApplicationController">
<!-- The nav bar that will be updated as we navigate -->
<ion-nav-bar class="bar-positive">
<ion-nav-buttons>
<div style="height:120px">
<p>Some button<p>
<p>Some button<p>
</div>
</ion-nav-buttons>
</ion-nav-bar>
<!-- where the initial view template will be rendered -->
<ion-nav-view>
<ion-view>
<ion-content></ion-content>
</ion-view>
</ion-nav-view>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment