Is it possible to use an inverse $watch
in Angular?
My problem
I using angular-translate and I want to use a $http.put
for every translation that is missing. But I get this error:
"10 $digets() iterations reached" when trying to $http.post() from ng-translate error handler
My solution
To solve this, I have created an array and I want to push all missing translations ID into it. When the page is ready, I want to put the array to my backend, where the the id's are be checked and saved into the database.
My question
But, how do I know when the page is ready, with other words, how do I know when angular is ready to push the missing translations into the array? I was thinking to an inverse $watch
function, so, an function was called when there is nothing written in the array/collection for, let's say, 1 second.
Is that possible, or are there better ways to solve this?
I have no code to show, since all codes are basic functions like $http
and array.push