Hello, I am facing an issue while using Angular JS in Eclipse. Specifically, when attempting to use Directives, I encounter a problem with the Cross-Origin Resource Sharing (CORS) policy when loading the Directives template in the index.html file.
XMLHttpRequest cannot load file:///Users/fanjavaid/Documents/Research%20and%20Development/workspaces_angularjs/usedirectives/app/js/directives/ArticleInfo.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Below is the JavaScript code for my directive:
app.directive('articleInfo', function() {
return {
restrict: 'E',
scope: {
info : '='
},
templateUrl: 'js/directives/ArticleInfo.html'
}
});
Here is the template for my Directive:
<div class="title"><h1>{{ article.title }}</h1></div>
<div class="meta" style="font-size:11px;"><strong>{{ article.meta }}</strong>, <strong>Comments :</strong> {{ article.comments }}</div>
<div class="content">
<p>{{ article.content }}</p>
</div>
I need assistance on how to resolve this CORS issue. Thank you.