I have inherited a site and I am trying to complete a final part. On all other controllers I have added a variation of
$timeout(function(){ //Issue is this doesn't seem to timeout...
$scope.rTapTopNumbersContainer = document.getElementById('rtap-quote-summary');
rTapNotifyDOMChange($scope.rTapTopNumbersContainer);
}, 100);
but on this final controller I cannot seem to add this code anywhere in the controller without the angular code not working, or where I have it at the moment, timeout. I need the timeout to fire to then update the HTML DOM.
If I put it in .success the timeout doesn't seem to work. Where can I put this code or how can I call this code after the $http has fired?
app.controller('summary', ['$scope', '$http', function($scope, $http, $timeout) {
var init = function () {
$http({
method: 'GET',
url: $scope.api + 'sites/site/?title=' + $scope.site
}).
success(function(data, status, headers, config) {
...assign vars to scope etc...
$timeout(function(){ //Issue is this doesn't seem to timeout...
$scope.rTapTopNumbersContainer = document.getElementById('rtap-summary');
rTapNotifyDOMChange($scope.rTapTopNumbersContainer);
}, 100);
}).
error(function(data, status, headers, config) {
});
}
init();
}]);