My brain is fried. I can't figure out what the issue is with my code.
Hmm, let me break it down for you.
File details:
Cordova version 2.9.1
AngularJS version 1.2.13 (also tested with the latest version 1.2.16)
Using Windows Phone 8 App
Here is the code snippet:
App.js
'use strict';
window.myApp = angular.module('myApp', ['ajoslin.mobile-navigate', 'ngMobile',
'myApp.Registermdl',
'myApp.login', 'myApp.CreateUsermdl', 'myApp.viewMap', 'myApp.createMap',
'myApp.logout', 'ngProgress', 'ngCookies','ngRoute'])
myApp.config(function ($routeProvider, $compileProvider) {
$compileProvider.aHrefSanitizationWhitelist(/^\s*(http?|ftp|mailto|file|tel):/);
$routeProvider.when('/', { templateUrl: 'index.html', controller: 'IndexCtrl' });
$routeProvider.when('/login', { templateUrl: 'app/login/login.html', controller: 'LoginCtrl' });
$routeProvider.when('/home', { templateUrl: 'app/home/home.htm', controller: 'HomeCtrl' });
// rest of the route configurations...
});
// IndexCtrl function...
var hostname = 'localhost:54938/';
var rootUrl = 'http://' + hostname;
and index page (main page)
<!DOCTYPE html>
<html xmlns:ng="http://angularjs.org" lang="en" ng-app="myApp">
<head>
<!-- Head content -->
</head>
<body>
<!-- Body content -->
</body>
</html>
The code works smoothly on all browsers, except in the Emulator. I've tried numerous solutions without success.
I sought help on Stack Overflow and someone suggested adding this line of code:
$compileProvider.aHrefSanitizationWhitelist(/^\s*(http?|ftp|mailto|file|tel):/);
Although I have already implemented it, the issue persists. It seems to be related to $routeProvider
not functioning correctly in the emulator (leading to a redirection problem).
I'm unsure if it's a version conflict or some other technical glitch...