Jay Jay - 1 year ago 93
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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download