{"action":"opened","issue":{"url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1118","labels_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1118/labels{/name}","comments_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1118/comments","events_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1118/events","html_url":"https://github.com/Urigo/angular-meteor/issues/1118","id":127803852,"number":1118,"title":"1.3.5 with ionic breaks $urlRouterProvider.otherwise() routing using john papa style","user":{"login":"mixersoft","id":231342,"avatar_url":"https://avatars.githubusercontent.com/u/231342?v=3","gravatar_id":"","url":"https://api.github.com/users/mixersoft","html_url":"https://github.com/mixersoft","followers_url":"https://api.github.com/users/mixersoft/followers","following_url":"https://api.github.com/users/mixersoft/following{/other_user}","gists_url":"https://api.github.com/users/mixersoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mixersoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixersoft/subscriptions","organizations_url":"https://api.github.com/users/mixersoft/orgs","repos_url":"https://api.github.com/users/mixersoft/repos","events_url":"https://api.github.com/users/mixersoft/events{/privacy}","received_events_url":"https://api.github.com/users/mixersoft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-20T22:54:34Z","updated_at":"2016-01-20T22:54:34Z","closed_at":null,"body":"I've been using the Angular Style Guide by John Papa for my ionic project (see: https://github.com/johnpapa/angular-styleguide#routing) and have recently been playing with `angular-meteor`. It works fine with `v.1.3.3` but I noticed that John Papa-style \"otherwise\" routing no longer works when I update to `angular-meteor#1.3.5`\r\n\r\nI created a sample app using `ionic start myApp sidemenu` and added `angular-meteor` to the project using bower. The sample app works fine using the standard `$urlRouterProvider` in `app.config`, but it fails when I switch to the john papa style routing in `app.run`. If I downgrade to `angular-meteor#1.3.0` it all works fine again. I tried to find the problem, but I had no success. Any ideas?\r\n\r\n\r\nmy `bower.json` file\r\n```\r\n{\r\n  \"name\": \"HelloIonic\",\r\n  \"private\": \"true\",\r\n  \"devDependencies\": {\r\n    \"ionic\": \"driftyco/ionic-bower#1.2.4\",\r\n    \"angular-meteor\": \"1.3.5\"\r\n  },\r\n  \"resolutions\": {\r\n    \"angular\": \"1.4.3\"\r\n  }\r\n}\r\n```\r\n\r\nmy `app.js` file\r\n```\r\n// Ionic Starter App\r\n//\r\nvar appRun = function($ionicPlatform) {\r\n  $ionicPlatform.ready(function() {\r\n    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard\r\n    // for form inputs)\r\n    if (window.cordova && window.cordova.plugins.Keyboard) {\r\n      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);\r\n      cordova.plugins.Keyboard.disableScroll(true);\r\n\r\n    }\r\n    if (window.StatusBar) {\r\n      // org.apache.cordova.statusbar required\r\n      StatusBar.styleDefault();\r\n    }\r\n  });\r\n}\r\n\r\nvar appConfig = function($stateProvider, $urlRouterProvider) {\r\n  $stateProvider\r\n\r\n  .state('app', {\r\n    url: '/app',\r\n    abstract: true,\r\n    templateUrl: 'templates/menu.html',\r\n    controller: 'AppCtrl'\r\n  })\r\n\r\n  .state('app.search', {\r\n    url: '/search',\r\n    views: {\r\n      'menuContent': {\r\n        templateUrl: 'templates/search.html'\r\n      }\r\n    }\r\n  })\r\n\r\n  .state('app.browse', {\r\n      url: '/browse',\r\n      views: {\r\n        'menuContent': {\r\n          templateUrl: 'templates/browse.html'\r\n        }\r\n      }\r\n    })\r\n\r\n  .state('app.playlists', {\r\n    url: '/playlists',\r\n    views: {\r\n      'menuContent': {\r\n        templateUrl: 'templates/playlists.html',\r\n        controller: 'PlaylistsCtrl'\r\n      }\r\n    }\r\n  })\r\n\r\n  .state('app.single', {\r\n    url: '/playlists/:playlistId',\r\n    views: {\r\n      'menuContent': {\r\n        templateUrl: 'templates/playlist.html',\r\n        controller: 'PlaylistCtrl'\r\n      }\r\n    }\r\n  })\r\n  // if none of the above states are matched, use this as the fallback\r\n  $urlRouterProvider.otherwise('/app/playlists');\r\n}\r\n\r\n\r\n/*\r\nrouterHelper is defined in johnpapa-style.js\r\n */\r\n\r\nvar johnPapaRun = function(routerHelper) {\r\n  otherwisePath = '/app/browse';\r\n  return routerHelper.configureStates(johnPapaConfig(), otherwisePath);\r\n};\r\n\r\nvar johnPapaConfig = function() {\r\n  return [\r\n    {\r\n      state: 'app',\r\n      config: {\r\n        url: '/app',\r\n        abstract: true,\r\n        templateUrl: 'templates/menu.html',\r\n        controller: 'AppCtrl'\r\n      }\r\n    } , {\r\n      state: 'app.search',\r\n      config: {\r\n        url: '/search',\r\n        views: {\r\n          'menuContent': {\r\n            templateUrl: 'templates/search.html'\r\n          }\r\n        }\r\n      }\r\n    } , {\r\n      state: 'app.browse',\r\n      config: {\r\n        url: '/browse',\r\n        views: {\r\n          'menuContent': {\r\n            templateUrl: 'templates/browse.html'\r\n          }\r\n        }\r\n      }\r\n    } , {\r\n      state: 'app.single',\r\n      config: {\r\n        url: '/playlists/:playlistId',\r\n        views: {\r\n          'menuContent': {\r\n            templateUrl: 'templates/playlist.html',\r\n            controller: 'PlaylistCtrl'\r\n          }\r\n        }\r\n      }\r\n    } , {\r\n      state: 'app.playlists',\r\n      config: {\r\n        url: '/playlists',\r\n        views: {\r\n          'menuContent': {\r\n            templateUrl: 'templates/playlists.html',\r\n            controller: 'PlaylistsCtrl'\r\n          }\r\n        }\r\n      }\r\n    }\r\n  ]\r\n}\r\n\r\n\r\n\r\n\r\n\r\n// angular.module is a global place for creating, registering and retrieving Angular modules\r\n// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)\r\n// the 2nd parameter is an array of 'requires'\r\n// 'starter.controllers' is found in controllers.js\r\nangular.module('starter', ['ionic', 'angular-meteor', 'starter.johnpapa', 'starter.controllers'])\r\n\r\n.run(appRun)\r\n// .config(appConfig);    // this works\r\n.run(johnPapaRun);        // this does NOT work\r\n```\r\n\r\nand `johnpapa-style.js`\r\n```\r\n\r\n(function() {\r\n  'use strict';\r\n  var routerHelperProvider;\r\n\r\n  routerHelperProvider = function($locationProvider, $stateProvider, $urlRouterProvider) {\r\n    var RouterHelper;\r\n    RouterHelper = function($state) {\r\n      var configureStates, getStates, hasOtherwise, service;\r\n      hasOtherwise = false;\r\n      configureStates = function(states, otherwisePath) {\r\n        states.forEach(function(state) {\r\n          return $stateProvider.state(state.state, state.config);\r\n        });\r\n        if (otherwisePath && !hasOtherwise) {\r\n          hasOtherwise = true;\r\n          return $urlRouterProvider.otherwise(otherwisePath);\r\n        }\r\n      };\r\n      getStates = function() {\r\n        return $state.get();\r\n      };\r\n      service = {\r\n        configureStates: configureStates,\r\n        getStates: getStates\r\n      };\r\n      return service;\r\n    };\r\n    RouterHelper.$inject = ['$state'];\r\n    this.$get = RouterHelper;\r\n  };\r\n\r\n  routerHelperProvider.$inject = ['$locationProvider', '$stateProvider', '$urlRouterProvider'];\r\n\r\n  angular.module('starter.johnpapa',[])\r\n    .provider('routerHelper', routerHelperProvider);\r\n\r\n}).call(this);\r\n```"}}