Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Ionic Starter App
  2.  
  3. // angular.module is a global place for creating, registering and retrieving Angular modules
  4. // 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
  5. // the 2nd parameter is an array of 'requires'
  6. angular.module('starter', ['ionic', 'starter.controller'])
  7.  
  8. .run(function($ionicPlatform) {
  9.   $ionicPlatform.ready(function() {
  10.     if(window.cordova && window.cordova.plugins.Keyboard) {
  11.       // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
  12.       // for form inputs)
  13.       cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  14.  
  15.       // Don't remove this line unless you know what you are doing. It stops the viewport
  16.       // from snapping when text inputs are focused. Ionic handles this internally for
  17.       // a much nicer keyboard experience.
  18.       cordova.plugins.Keyboard.disableScroll(true);
  19.     }
  20.     if(window.StatusBar) {
  21.       StatusBar.styleDefault();
  22.     }
  23.   });
  24. }).config(function($stateProvider, $urlRouterProvider) {
  25.   $stateProvider
  26.  
  27.   .state('app', {
  28.     abstract: true,
  29.     template: '<ion-nav-view></ion-nav-view>'
  30.   })
  31.  
  32.   .state('app.index', {
  33.     url: '/index',
  34.     template: 'index <br><br><br><br> <a href="#/single">single</a>',
  35.     controller: 'index',
  36.   })
  37.  
  38.   .state('app.single', {
  39.     url: '/single',
  40.     template: 'single <br><br><br><br> <a href="#/">index</a>',
  41.     controller: 'single',
  42.   });
  43.  
  44.   $urlRouterProvider.otherwise('/index');
  45. });
  46.  
  47.  
  48. angular.module('starter.controller', [])
  49.   .controller('index', function(){
  50.     console.log('index');
  51.   })
  52.  
  53.   .controller('single', function(){
  54.     console.log('single');
  55.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement