Wrap update in $scope.$apply