Angular behaves differently in Cordoba

I am creating an angular application with several modules located next to john papas styleguide . After that, I have several independent modules with my own route definitions, and others with interceptors. My problem: when I run it on Cordoba / Android, state definitions only work when I put them in the main module. It works in my browser. Has anyone else come up with this question?

eg. this works both in the local browser and on the device with the corridor:

//main.js 'use strict'; angular.module('main', [ 'app.core', 'auth' ]) .config(function ($stateProvider, $urlRouterProvider) { // ROUTING with ui.router $urlRouterProvider.otherwise('/main/list'); $stateProvider // this state is placed in the <ion-nav-view> in the index.html .state('main', { url: '/main', abstract: true, templateUrl: 'main/templates/menu.html', controller: 'MenuCtrl as menu' }) .state('main.login', { url: '/login', views: { 'pageContent': { templateUrl: 'auth/templates/auth.login.html', controller: 'LoginCtrl' } } }) /* more states here */ 

This only works in the local browser (the main module is the same as above):

 //auth.routes.js 'use strict'; angular .module('auth.routes') .config(config); function config ($stateProvider) { $stateProvider .state('main.login', { url: '/login', views: { 'pageContent': { templateUrl: 'auth/templates/auth.login.html', controller: 'LoginCtrl' } } }) } //auth.module.js 'use strict'; angular.module('auth', [ 'app.core', 'auth.constants', 'auth.routes', 'auth.controllers', 'auth.services', 'auth.interceptors', 'auth.config' ]); angular.module('auth.constants', []); angular.module('auth.routes', []); angular.module('auth.controllers', []); angular.module('auth.services', []); angular.module('auth.interceptors', []); angular.module('auth.config', []); 

The error indicates that the state was not detected during navigation.

+6
source share
1 answer

Try

 angular .module('test', []) .config(config); config.$inject = ['$routeProvider']; function config($routeProvider) { $routeProvider .when('/login', { title: 'Calculators', templateUrl: 'modules/views/login.html', controller: '' }); } 

remove the state provider, check that simple routing will work.

0
source

All Articles