Q: Getting error when trying get JSON from remote url I'm trying load this json file from remote url. In the beginning I was using $http.get function, but I was getting the next error message: 

CORS 'Access-Control-Allow-Origin'

Now I am using JSONP, but nothing happens.
service.js file:
angular.module("elcomaApp").factory('ElcomaService', ['$http', function($http){
    return $http({
        method: 'JSONP',
        url: 'http://vagalumewifi.com.br/timeline.json'
    }).success(function(response){
        return response.data;
    }).error(function(err){
        return err;
    });

}]);

controller.js file:
angular.module("elcomaApp", []).controller('MainController', ['$scope', 'ElcomaService', function($scope, ElcomaService){
    $scope.name = 'Natanael Santos';
    console.log($scope.name);
    ElcomaService.success(function(data){
        $scope.elcomaData = JSON.parse(data);
        var i = 0;
        for (x in $scope.elcomaData){

            console.log(i);
            i++;
            console.log(x.date);
        }
    }).error(function(data){
        console.log(data);
    });
}]);

app.js file:
var app = angular.module("elcomaApp", ['ngMaterial', 'ngRoute']);

I already hava read a lot of articles on stackoverflow, but no one work for me.

A: I'd suggest using $http.jsonp(url) method:
angular.module("elcomaApp").factory('ElcomaService', ['$http', function($http) {
  $http.jsonp('http://vagalumewifi.com.br/timeline.json')
    .success(function(data) {
      console.log(data); // you can't `return` here...
    }).error(function(err){
      console.err(err);
    });
}]);

Note: be warned that you can't expect that return in an async method has the same behavior as in a sync environment... :-)

A: Your original error is your clue.  The endpoint server won't allow access from another domain.
CORS: Cross Origin Requests
You need to allow access on the endpoint server for the type of HTTP method you want to use (i.e. GET, POST, HEAD, ...)  Additionally depending on what you're doing you may need to allow for an OPTIONS request, see Preflighted Requests in the MDN documentation above.
If you don't have access to that server you may need to do a work around by making $http call a script on your server that will fetch the file for you.  I've done this before using PHP as a proxy and using PHP's file_get_contents function to grab files from other servers of a different domain.
