Migrate setTimeout to $timeout