Last active
March 5, 2016 22:35
-
-
Save mmnaseri/ef5de9e1c9cb452316e0 to your computer and use it in GitHub Desktop.
Ionic tabs application with sidemenu on a single page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('ionicApp', ['ionic']) | |
.config(function ($stateProvider, $urlRouterProvider, $ionicConfigProvider) { | |
$ionicConfigProvider.tabs.position('bottom'); | |
$stateProvider | |
.state('tabs', { | |
url: "/tabs", | |
templateUrl: "templates/tabs.html" | |
}) | |
.state('tabs.listing', { | |
url: "/listing", | |
views: { | |
'tabs-listing': { | |
templateUrl: "templates/menu.html" | |
} | |
} | |
}) | |
.state('tabs.listing.home', { | |
url: "/home", | |
views: { | |
'listing-view': { | |
templateUrl: "templates/home.html" | |
} | |
} | |
}) | |
.state('tabs.search', { | |
url: "/search", | |
views: { | |
'tabs-search': { | |
templateUrl: "templates/search.html" | |
} | |
} | |
}); | |
$urlRouterProvider.otherwise("/tabs/listing/home"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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>ionicApp</title> | |
<link href="http://code.ionicframework.com/1.2.4/css/ionic.min.css" rel="stylesheet"> | |
<script src="http://code.ionicframework.com/1.2.4/js/ionic.bundle.min.js"></script> | |
<script src="js/app.js"></script> | |
</head> | |
<body> | |
<ion-nav-view></ion-nav-view> | |
<script id="templates/menu.html" type="text/ng-template"> | |
<ion-side-menus> | |
<ion-side-menu-content> | |
<ion-nav-bar class="bar-calm"> | |
<ion-nav-back-button> | |
</ion-nav-back-button> | |
<ion-nav-buttons side="right"> | |
<button class="button button-icon button-clear ion-ios-settings" menu-toggle="right"> | |
</button> | |
</ion-nav-buttons> | |
</ion-nav-bar> | |
<ion-nav-view name="listing-view"></ion-nav-view> | |
</ion-side-menu-content> | |
<ion-side-menu side="right"> | |
<ion-header-bar class="bar-dark"> | |
<h1 class="title">Filter</h1> | |
</ion-header-bar> | |
<ion-content class="has-header"> | |
<ion-list> | |
<ion-item menu-close ui-sref="tabs.listing.home">Home</ion-item> | |
</ion-list> | |
</ion-content> | |
</ion-side-menu> | |
</ion-side-menus> | |
</script> | |
<script id="templates/tabs.html" type="text/ng-template"> | |
<ion-view view-title="Welcome"> | |
<ion-tabs class="tabs-icon-top tabs-positive"> | |
<ion-tab title="Home" icon="ion-ios-home" ui-sref="tabs.listing.home"> | |
<ion-nav-view name="tabs-listing"></ion-nav-view> | |
</ion-tab> | |
<ion-tab title="Search" icon="ion-ios-search-strong" ui-sref="tabs.search"> | |
<ion-nav-view name="tabs-search"></ion-nav-view> | |
</ion-tab> | |
</ion-tabs> | |
</ion-view> | |
</script> | |
<script id="templates/home.html" type="text/ng-template"> | |
<ion-view view-title="Home"> | |
<ion-content> | |
<p>This is the home page</p> | |
</ion-content> | |
</ion-view> | |
</script> | |
<script id="templates/search.html" type="text/ng-template"> | |
<ion-view view-title="Search"> | |
<ion-nav-bar class="bar-calm"> | |
<ion-nav-back-button> | |
</ion-nav-back-button> | |
</ion-nav-bar> | |
<ion-content> | |
<p>This is the search page</p> | |
</ion-content> | |
</ion-view> | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment