I'm writing an application on mobile platform steroids, angular.js and firebase.js. Recently I've faced such problem: the page does not load, because it is trying to access a strange url file://file:///Users/patutinskijfedor/Desktop/firebase/WILLY/www/
.
Error: Failed to execute 'replaceState' on 'History': A history state object with URL 'file://file:///Users/patutinskijfedor/Desktop/firebase/WILLY/www/' cannot be created in a document with origin 'null'.
I read about this issue in the Internet and realized that my problem is with the routing in angular. It look like this (file app.js
):
angular.module('SCBI', ['SCBI.controllers','ngRoute']).config(function($routeProvider, $locationProvider){
$locationProvider.html5Mode(true);
$routeProvider.when('/teachers',{ templateUrl: 'teachers.html'});
$routeProvider.when('/teachers/:id', {templateUrl: 't.html', controller: 'TeachersListController'});
$routeProvider.when('/', {templateUrl: 'authorization.html', controller: 'AuthorizationController'});
$routeProvider.otherwise({redirectTo:'/'});
});
So the problem might be with html5Mode
. My question is: how can I fix the routing in app.js
? The full code of the project is here: https://github.com/patut/SCBI.