标签:
In AngularJS 1.3.x, using $locationProvider.html5Mode(ture), will cause a Error:$location:nobase error.
angular.module(‘app‘, [‘ngResource‘, ‘ngRoute‘]) .config(function($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider .when(‘/‘, { templateUrl: ‘/partials/main/main‘, controller: ‘MainController‘ }) .when(‘/admin/users‘, { templateUrl: ‘/partials/admin/user_list‘, controller: ‘usrListController‘ }); });
To Fix this, simply add
<base href="/" />
to the index.html head.
[AngularJS] Error: $location:nobase
标签:
原文地址:http://www.cnblogs.com/Answer1215/p/4504924.html