Following the tutorial provided here for routing in AngularJS, I am trying to run the same in my local.
I have the index.html as
index.html
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-route.js"></script>
<body ng-app="myApp">
<p><a href="#/">Main</a></p>
<a href="#red">Red</a>
<a href="#green">Green</a>
<a href="#blue">Blue</a>
<div ng-view></div>
<script>
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "main.htm"
})
.when("/red", {
templateUrl : "red.htm"
})
.when("/green", {
templateUrl : "green.htm"
})
.when("/blue", {
templateUrl : "blue.htm"
});
});
</script>
</body>
</html>
main.htm
<html>
<head></head>
<body>
This is main
</body>
</html>
red.htm
<html>
<head></head>
<body>
This is red
</body>
</html>
And so for green.htm and blue.htm
When I run in Firefox, it works as expected - output below
But the same when I open in Chrome, the result is
What I need to do for resolving this CORS issue?