Angularjs route seems not working in cordova android build

I’ve updated my code to get the template from /templates/*.html using angularjs route.

myModule.config(function($stateProvider, $urlRouterProvider){
$stateProvider
	.state('home', {
		url: '/',
		templateUrl: '/templates/home.html',
		controller: 'homeCtrl'
	})
	.state('settings', {
		url: '/settings',
		templateUrl: '/templates/settings.html',
		controller: 'settingsCtrl'
	});
$urlRouterProvider.otherwise("/");
})

So this code just works GREAT!! without any problem on local server (running with python simpleHTTPServer / with chrome browser), however when I build and run on android, I just get blank page (meaning the template is not being loaded).
Any advise?

Sorry I was really stupid…
I changed template URL to be

templateUrl: 'templates/settings.html', 

without “/” infront, now it works…

1 Like