Repository: driftyco/ionic-starter-tabs Branch: master Commit: 49e7cc7de515 Files: 13 Total size: 9.3 KB Directory structure: gitextract_h1t6bon_/ ├── README.md ├── css/ │ └── style.css ├── index.html ├── js/ │ ├── app.js │ ├── controllers.js │ └── services.js ├── manifest.json ├── service-worker.js └── templates/ ├── chat-detail.html ├── tab-account.html ├── tab-chats.html ├── tab-dash.html └── tabs.html ================================================ FILE CONTENTS ================================================ ================================================ FILE: README.md ================================================ ### :point_right: This starter repo has moved to the [ionic-team/starters](https://github.com/ionic-team/starters/tree/master/ionic1/official/tabs) repo! :point_left: ================================================ FILE: css/style.css ================================================ /* Empty. Add your own CSS if you like */ ================================================ FILE: index.html ================================================ ================================================ FILE: js/app.js ================================================ // Ionic Starter App // angular.module is a global place for creating, registering and retrieving Angular modules // 'starter' is the name of this angular module example (also set in a attribute in index.html) // the 2nd parameter is an array of 'requires' // 'starter.services' is found in services.js // 'starter.controllers' is found in controllers.js angular.module('starter', ['ionic', 'starter.controllers', 'starter.services']) .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 && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true); } if (window.StatusBar) { // org.apache.cordova.statusbar required StatusBar.styleDefault(); } }); }) .config(function($stateProvider, $urlRouterProvider) { // Ionic uses AngularUI Router which uses the concept of states // Learn more here: https://github.com/angular-ui/ui-router // Set up the various states which the app can be in. // Each state's controller can be found in controllers.js $stateProvider // setup an abstract state for the tabs directive .state('tab', { url: '/tab', abstract: true, templateUrl: 'templates/tabs.html' }) // Each tab has its own nav history stack: .state('tab.dash', { url: '/dash', views: { 'tab-dash': { templateUrl: 'templates/tab-dash.html', controller: 'DashCtrl' } } }) .state('tab.chats', { url: '/chats', views: { 'tab-chats': { templateUrl: 'templates/tab-chats.html', controller: 'ChatsCtrl' } } }) .state('tab.chat-detail', { url: '/chats/:chatId', views: { 'tab-chats': { templateUrl: 'templates/chat-detail.html', controller: 'ChatDetailCtrl' } } }) .state('tab.account', { url: '/account', views: { 'tab-account': { templateUrl: 'templates/tab-account.html', controller: 'AccountCtrl' } } }); // if none of the above states are matched, use this as the fallback $urlRouterProvider.otherwise('/tab/dash'); }); ================================================ FILE: js/controllers.js ================================================ angular.module('starter.controllers', []) .controller('DashCtrl', function($scope) {}) .controller('ChatsCtrl', function($scope, Chats) { // With the new view caching in Ionic, Controllers are only called // when they are recreated or on app start, instead of every page change. // To listen for when this page is active (for example, to refresh data), // listen for the $ionicView.enter event: // //$scope.$on('$ionicView.enter', function(e) { //}); $scope.chats = Chats.all(); $scope.remove = function(chat) { Chats.remove(chat); }; }) .controller('ChatDetailCtrl', function($scope, $stateParams, Chats) { $scope.chat = Chats.get($stateParams.chatId); }) .controller('AccountCtrl', function($scope) { $scope.settings = { enableFriends: true }; }); ================================================ FILE: js/services.js ================================================ angular.module('starter.services', []) .factory('Chats', function() { // Might use a resource here that returns a JSON array // Some fake testing data var chats = [{ id: 0, name: 'Ben Sparrow', lastText: 'You on your way?', face: 'img/ben.png' }, { id: 1, name: 'Max Lynx', lastText: 'Hey, it\'s me', face: 'img/max.png' }, { id: 2, name: 'Adam Bradleyson', lastText: 'I should buy a boat', face: 'img/adam.jpg' }, { id: 3, name: 'Perry Governor', lastText: 'Look at my mukluks!', face: 'img/perry.png' }, { id: 4, name: 'Mike Harrington', lastText: 'This is wicked good ice cream.', face: 'img/mike.png' }]; return { all: function() { return chats; }, remove: function(chat) { chats.splice(chats.indexOf(chat), 1); }, get: function(chatId) { for (var i = 0; i < chats.length; i++) { if (chats[i].id === parseInt(chatId)) { return chats[i]; } } return null; } }; }); ================================================ FILE: manifest.json ================================================ { "name": "My Ionic App", "short_name": "My Ionic App", "start_url": "index.html", "display": "standalone", "icons": [{ "src": "icon.png", "sizes": "512x512", "type": "image/png" }] } ================================================ FILE: service-worker.js ================================================ self.addEventListener('activate', function (event) { }); self.addEventListener('fetch', function (event) { }); self.addEventListener('push', function (event) { }); ================================================ FILE: templates/chat-detail.html ================================================

{{chat.lastText}}

================================================ FILE: templates/tab-account.html ================================================ Enable Friends ================================================ FILE: templates/tab-chats.html ================================================

{{chat.name}}

{{chat.lastText}}

Delete
================================================ FILE: templates/tab-dash.html ================================================

Welcome to Ionic

This is the Ionic starter for tabs-based apps. For other starters and ready-made templates, check out the Ionic Market.

To edit the content of each tab, edit the corresponding template file in www/templates/. This template is www/templates/tab-dash.html

If you need help with your app, join the Ionic Community on the Ionic Forum. Make sure to follow us on Twitter to get important updates and announcements for Ionic developers.

Psst! - Try Ionic View to easily share and test your app with clients and co-workers.

================================================ FILE: templates/tabs.html ================================================