Using $q.when instead of forcing delay with $timeout.