diff --git a/js/angular/directive/tabs.js b/js/angular/directive/tabs.js index 31f063a41a..983525de62 100644 --- a/js/angular/directive/tabs.js +++ b/js/angular/directive/tabs.js @@ -43,9 +43,187 @@ * @param {string=} delegate-handle The handle used to identify these tabs * with {@link ionic.service:$ionicTabsDelegate}. */ -IonicModule +/** + * @ngdoc demo + * @name ionTabs#navigation + * @module tabsAndNavigation + * @javascript +angular.module('tabsAndNavigation', ['ionic']) +.config(function ($stateProvider, $urlRouterProvider) { -.directive('ionTabs', ['$ionicViewService', '$ionicTabsDelegate', function($ionicViewService, $ionicTabsDelegate) { + $stateProvider + .state('tabs', { + url: "/tab", + abstract: true, + templateUrl: "tabs.html" + }) + .state('tabs.home', { + url: "/home", + views: { + 'home-tab': { + templateUrl: "home.html", + controller: 'HomeTabCtrl' + } + } + }) + .state('tabs.facts', { + url: "/facts", + views: { + 'home-tab': { + templateUrl: "facts.html" + } + } + }) + .state('tabs.facts2', { + url: "/facts2", + views: { + 'home-tab': { + templateUrl: "facts2.html" + } + } + }) + .state('tabs.about', { + url: "/about", + views: { + 'about-tab': { + templateUrl: "about.html" + } + } + }) + .state('tabs.navstack', { + url: "/navstack", + views: { + 'about-tab': { + templateUrl: "nav-stack.html" + } + } + }) + .state('tabs.contact', { + url: "/contact", + views: { + 'contact-tab': { + templateUrl: "contact.html" + } + } + }); + + + $urlRouterProvider.otherwise("/tab/home"); + +}) + +.controller('HomeTabCtrl', function ($scope) { + console.log('We have arrived at HomeTabCtrl.'); +}); + * + * @html + + + + + + + + + + + + + + + + + + + + +*/ + +IonicModule +.directive('ionTabs', [ + '$ionicViewService', + '$ionicTabsDelegate', +function($ionicViewService, $ionicTabsDelegate) { return { restrict: 'E', scope: true,