fix(collectionRepeat): correctly save user scroll position on back

Addresses #1157
This commit is contained in:
Andy Joslin
2014-05-05 10:38:33 -06:00
parent e6e1896629
commit 0a64075884
2 changed files with 12 additions and 9 deletions

View File

@@ -124,11 +124,12 @@ describe('$ionicScroll Controller', function() {
expect(ctrl.scrollToRememberedPosition).toHaveBeenCalled();
});
it('should forget on $viewHistory.viewBack after $viewContentLoaded', inject(function($rootScope) {
it('should forget on $viewHistory.viewBack after $viewContentLoaded', inject(function($rootScope, $timeout) {
var historyData = { viewId: 'foo' };
setup();
spyOn($rootScope, '$on').andCallThrough();;
scope.$broadcast('$viewContentLoaded', historyData);
$timeout.flush();
expect(scope.$on).toHaveBeenCalledWith('$viewHistory.viewBack', jasmine.any(Function));
//Should not forget unless backViewId is the same