diff --git a/src/viewScroll.js b/src/viewScroll.js index dfe0a030d..81114e20d 100644 --- a/src/viewScroll.js +++ b/src/viewScroll.js @@ -42,7 +42,7 @@ function $ViewScrollProvider() { } return function ($element) { - $timeout(function () { + return $timeout(function () { $element[0].scrollIntoView(); }, 0, false); }; diff --git a/test/viewScrollSpec.js b/test/viewScrollSpec.js index c46cae198..f51a0c7fe 100644 --- a/test/viewScrollSpec.js +++ b/test/viewScrollSpec.js @@ -17,6 +17,14 @@ describe('uiView', function () { $timeout.flush(); expect(elem[0].scrollIntoView).toHaveBeenCalled(); })); + + it('should return the promise from the timeout', inject(function ($uiViewScroll, $timeout) { + var promise = $uiViewScroll(elem); + + $timeout.flush(); + expect(elem[0].scrollIntoView).toHaveBeenCalled(); + expect(promise).toBeDefined(); + })); }); describe('useAnchorScroll', function () {