0

I am working on a sample application using angular js. I am a newbie , so please bear with me

I have the following code in my controllers.js :

var myApp = angular.module('myApp', []);

myApp.controller('MyController', ['$scope', '$http', function ($scope, $http) {
    $http.get('js/data.json').success(function (data) {
        $scope.artists = data;
        $scope.artistOrder = 'name';
    });
}]);

Here , i am using http.get to load json data into application from a text file as shown above.

I am using IE 9 and was allowed to use only that , not any browser.

When i execute the above code, i am encountering an error as stated below :

CSS3117: @font-face failed cross-origin request. Resource access is restricted

I am not sure what is a cross-origin request . I am wondering why a simple http get requested is getting failed.

Here are my queries :

  1. What is a cross origin request? An example would be great
  2. How this holds w.r.t my example above ?
  3. What is the remedy/solution/alternative for this ?
Sai Avinash
  • 4,683
  • 17
  • 58
  • 96
  • seems like your question is related to IE 9 and font-face: http://stackoverflow.com/questions/5065362/ie9-blocks-download-of-cross-origin-web-font Cross origin means that you are on domianA.com and trying to access resources on domainB.com – Marian Ban Nov 05 '14 at 14:01

1 Answers1

-1

Try defining a var outside the controller:

this.artists = {};

And then, inside the controller:

this.artists = data;

So the page can access that var. Otherside you can only access it inside the controller.

raulchopi
  • 328
  • 1
  • 9