My situation: I want to update height of side-menu (it is dynamic, its items are loaded from server). I know need to using $timeout
to waiting angular build DOM done.
Bellow code is right
$scope.data = WebService.getData(function () {
// doing something with $scope.data
// must put the in here, after server return result.
// angular using the result to build DOM again (changed everything will be destroyed)
// using $timeout to waiting angular done
$timeout(function() {
$('#side-menu').css('height', ($(window).height() - 160) + 'px');
}, 1000);
});