104 plunker ionic sidemenu tabs
.
104-plunker-ionic-sidemenu-tabs
HTML+CSS+JS
<html> <head> <meta charset="utf-8"> <title>Diary</title> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <!-- Internal Library <link href="lib/ionic/css/ionic.css" rel="stylesheet"><script src="lib/ionic/js/ionic.bundle.js"></script> --> <!-- Cloud Library --> <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet"> <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script> <!-- Needed for Cordova/PhoneGap (will be a 404 during development) --> <!--<script src="cordova.js"></script>--> </head> <body ng-app="app"> <div> <div> <ion-side-menus enable-menu-with-back-views="false" data-componentid="side-menu21"> <ion-side-menu-content> <ion-nav-bar class="bar-stable"> <ion-nav-back-button></ion-nav-back-button> <ion-nav-buttons side="left"> <button class="button button-icon button-clear ion-navicon" menu-toggle="left"></button> </ion-nav-buttons> </ion-nav-bar> <ion-nav-view></ion-nav-view> </ion-side-menu-content> <ion-side-menu side="left" id="side-menu21"> <ion-header-bar class="bar-stable"> <div class="title">Menu</div> </ion-header-bar> <ion-content ng-controller="menuCtrl" padding="false" class="side-menu-left has-header "> <ion-list id="menu-list1" data-componentid="list1"> <ion-item id="menu-list-item1" ui-sref="tabsController.cameraTabDefaultPage" menu-close="" data-componentid="list-item1">Camera</ion-item> <ion-item id="menu-list-item2" ui-sref="tabsController.cartTabDefaultPage" menu-close="" data-componentid="list-item2">Cart</ion-item> <ion-item id="menu-list-item3" ui-sref="tabsController.cloudTabDefaultPage" menu-close="" data-componentid="list-item3">Cloud</ion-item> </ion-list> </ion-content> </ion-side-menu> </ion-side-menus> </div> </div> <script id="tabsController.html" type="text/ng-template"> <ion-view id="page1"> <ion-tabs class="tabs-stable tabs-icon-top" id="tabsController-tabs1"> <ion-tab title="Camera Tab" icon="ion-ios-camera" href="#/page1/page2" id="tabsController-tab1"> <ion-nav-view name="tab1"></ion-nav-view> </ion-tab> <ion-tab title="Cart Tab" icon="ion-ios-cart" href="#/page1/page3" id="tabsController-tab2"> <ion-nav-view name="tab2"></ion-nav-view> </ion-tab> <ion-tab title="Cloud Tab" icon="ion-ios-cloud" href="#/page1/page4" id="tabsController-tab3"> <ion-nav-view name="tab3"></ion-nav-view> </ion-tab> </ion-tabs> </ion-view> </script> <script id="cameraTabDefaultPage.html" type="text/ng-template"> <ion-view title="Camera Tab Default Page" id="page2"> <ion-content padding="true" class="has-header"></ion-content> </ion-view> </script> <script id="cartTabDefaultPage.html" type="text/ng-template"> <ion-view title="Cart Tab Default Page" id="page3"> <ion-content padding="true" class="has-header"></ion-content> </ion-view> </script> <script id="cloudTabDefaultPage.html" type="text/ng-template"> <ion-view title="Cloud Tab Default Page" id="page4"> <ion-content padding="true" class="has-header"></ion-content> </ion-view> </script> <script> angular.module(app, [ionic]) .controller(cameraTabDefaultPageCtrl, [$scope, $stateParams, function ($scope, $stateParams) { }]) .controller(cartTabDefaultPageCtrl, [$scope, $stateParams, function ($scope, $stateParams) { }]) .controller(cloudTabDefaultPageCtrl, [$scope, $stateParams, function ($scope, $stateParams) { }]) .controller(menuCtrl, [$scope, $stateParams, function ($scope, $stateParams) { }]) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state(tabsController.cameraTabDefaultPage, { url: /page2, views: { tab1: { templateUrl: cameraTabDefaultPage.html, controller: cameraTabDefaultPageCtrl } } }) .state(tabsController.cartTabDefaultPage, { url: /page3, views: { tab2: { templateUrl: cartTabDefaultPage.html, controller: cartTabDefaultPageCtrl } } }) .state(tabsController.cloudTabDefaultPage, { url: /page4, views: { tab3: { templateUrl: cloudTabDefaultPage.html, controller: cloudTabDefaultPageCtrl } } }) .state(tabsController, { url: /page1, templateUrl: tabsController.html, abstract:true }) $urlRouterProvider.otherwise(/page1/page2) }); link download
Subscribe to:
Post Comments (Atom)
|
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.