Hi guys,
I think I’m running into a related issue and you may be able to help.
In my case the application is based on the tabs template and has a state configuration like the following:
$stateProvider
.state(‘intro’, {
url: ‘/intro’,
templateUrl: ‘ui/intro.html’,
controller: ‘IntroCtrl’
})
.state(‘app’, {
url: “/app”,
abstract: true,
templateUrl: ‘ui/tabs.html’,
controller: ‘TabsHeadersCtrl’,
})
.state(‘app.frontpage’, {
url: ‘/frontpage’,
views: {
‘tab-content-0’: {
templateUrl: ‘ui/frontpage.html’,
controller: ‘FrontPageCtrl’
}
}
})
//… etc …
;
$urlRouterProvider.otherwise(’/app/frontpage’);
Also I’ve configured the Angular sanitization whitelists as follows:
$compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file)|data:image/|/?img//);
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|ghttps?|ms-appx|x-wmapp0)|/?app//);
I’m using Ionic 1.0.0-beta11 on Cordova 3.5.0, with a modified XHRHelper.cs (got it from here).
The thing is I got it working on WP8.1 (emulator and device) but the app simply doesn’t start on WP8.0 (emulator). Analyzing the logs I saw that it reaches the TabsHeadersCtrl
(from the app
abstract state), but it never runs the FrontPageCtrl
, which should be loaded by default by $urlRouterProvider.otherwise()
.
I also tried to enabled traces on the app’s state changes with:
$rootScope.$on(’$stateChangeStart’, function(evt, toState, toParams, fromState, fromParams){
console.log(">> Changing from state " + fromState.name + ", to " + toState.name);
});
$rootScope.$on(’$stateChangeSuccess’, function(evt, toState, toParams, fromState, fromParams){
console.log(">> Completed transition from state " + fromState.name + ", to " + toState.name);
});
But never saw the expected >> Completed transition from state , to app.frontpage
at start-up.
Any ideas about why it works on WP8.1 but doesn’t on WP8.0?. How’s possible that the $urlRouterProvider
doesn’t redirect to '/app/frontpage'
(or so it seems) only on WP8.0?.
Thanks beforehand,
Rafa.