Hi i have a problem with angularjs and chrome, this is the code:
var angularRoutingApp = angular.module('angularRoutingApp', ['ngRoute'])
// Configuración de las rutas
.config(function($routeProvider)
{
$routeProvider
.when('/', {
templateUrl : 'pages/home.html',
controller : 'mainController'
})
.when('/artistas', {
templateUrl : 'pages/artistas.html',
controller : 'artistasController'
})
.when('/login', {
templateUrl : 'pages/login.html',
controller : 'loginController'
})
.otherwise({
redirectTo: '/'
});
});
If i open the index.html with Opera, Firefox or safary i dont have any proble, but if i open this with Chorme dont work the routerprovider and show me a error message in the console like this:
XMLHttpRequest cannot load file://localhost/Users/multivideo/Desktop/FTL-Angular/pages/home.html. Cross origin requests are only supported for HTTP. index.html:1
Error: A network error occurred.
at Error (native)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js:72:206
at C (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js:68:99)
at f (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js:66:69)
at C (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js:92:375)
at C (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js:92:375)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js:94:28
at h.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js:102:293)
at h.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js:100:50)
at h.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js:103:100) angular.js:9413
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…