Switch setTimeout() for angular's $timeout.