Jay Jay - 10 months ago 70
AngularJS Question

angular.min.js XMLHttpRequest cannot load file


/* app.js */

var model = angular.module('app',['ui.router']);

model.config(function($stateProvider, $urlRouterProvider){



url: '/home',
templateUrl: 'view/home.html',
controller: 'homeController'


/* home.js */



<!-- index.html -->

<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/angular.min.js" ></script>
<script type="text/javascript" src="js/angular-ui-router.min.js" ></script>
<script type="text/javascript" src="controller/app.js" ></script>
<script type="text/javascript" src="controller/home.js" ></script>
<body ng-app="app">
<header>Jayesh Shelar</header>
<div id="view" ui-view> </div>



I am getting error as "angular.min.js:103 XMLHttpRequest cannot load file Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource."

Answer Source

You can do npm install http-server -g and start the server in your project folder by using http-server command.