json parse within angularjs filter causes infinite loop

I have a filter function which makes a synchronous ajax call. The callback of the function returns a json object which is then passed to a variable of the filter function which is then returned as the filter result. An infinite loop of ajax calls are made ONLY when the dataType of the ajax call is set to 'json'. When returning a string, there is no infinite loop.

Why does this code, when placed inside a filter function, cause a recursive infinite loop?

        var result;
        that = this;
        $.ajax({
            url: '/url/',
            async: false,
            dataType: 'json',
            type: 'get',
            success: function (links) {

                that.result = links;
            }
        });

        return that.result;

  1. Do not use synchronous ajax cals.
  2. Do not use long time processing in filters = filters are called in each $digest cycle, so your long sync ajax call inside filter just freezing browser again and again.