Good evening! I'm learning angular.js and at the moment I'm trying to get access to the json-file to load some data from the server, but, ubfortunately, $http - method gives an error. Please? help me to find a mistake.
A code of the controller that sends a query:
(function(){
var app =angular.module('SCBI', []) ;
app.controller('TeachersController', function TeachersController ($scope, $http){
$http({method: 'GET', url: 'http://patutinskiy.esy.es/javascripts/json/all_teachers.json'}).
success(function(data, status, headers, config) {
$scope.teachers=data;
}).
error(function(data, status, headers, config) {
alert(status);
});
});
})();
Json-file is OK (checked in the parser). Thank you!