The following code is spam me thousands repeated $http request until the
browser stop working.
My only clue is something related to $digest.
I'm using v1.2.4.
// filter.js
(function (ng, app)
{
"use strict";
app.filter("Cidade", ["cidadeService", "$log", "$http", function
(cidadeService, $log, $http)
{
return function (input)
{
var promise = $http
({
method: "GET",
cache : true,
url: window.API_HOST + "/api/Cidades/" + input
});
return 'test';
};
}]);
})(window.angular, window.app)
// some index.html
<p>Cidade: {{ instituicao.Endereco.Cidade.Id | Cidade }}</p>
This is very simple to reproduce.
ps: i know this is not a good practice to put a service inside a filter,
does not make sense, it's like a view to know businesses rules from
controller. But this code is quick & dirty solution will soon
be refactored. (and this code is not originated mine)
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.