Instead of using setTimeout, use $timeout with false for invokeApply.