I try to load json file with angularjs, $q and return data from angular filter.
I have a angular filter:
MyApp.filter('my_filter', function ($q){
    return function(input){
        var deferred = $q.defer();
        var j = {};
        $.getJSON(url, function(json) {
            j = json;
            deferred.resolve(json);
        });
        return j;
But i got {}. How can i synchronously load json and return it's content from filter?
Thank you.
 
     
     
     
    