From abe9e65c6fbecf7c7c7610596ca5c15d9c6d839b Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Wed, 19 Mar 2014 13:06:35 -0600 Subject: [PATCH] docs(ionicScrollController): make rememberScrollPosition example clearer --- .../angular/src/controller/ionicScrollController.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/ext/angular/src/controller/ionicScrollController.js b/js/ext/angular/src/controller/ionicScrollController.js index 94a5466926..ac3d74d99e 100644 --- a/js/ext/angular/src/controller/ionicScrollController.js +++ b/js/ext/angular/src/controller/ionicScrollController.js @@ -15,7 +15,7 @@ angular.module('ionic.ui.scroll') * @name ionicScroll * @module ionic * @description - * Controller for the {@link ionic.directive:ionContent} and + * Controller for the {@link ionic.directive:ionContent} and * {@link ionic.directive:ionScroll} directives. */ .controller('$ionicScroll', [ @@ -170,12 +170,12 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca /** * @ngdoc method * @name ionicScroll#rememberScrollPosition - * @description + * @description * Will make it so, when this scrollView is destroyed (user leaves the page), - * the last scroll position the page was on will be saved, indexed by the + * the last scroll position the page was on will be saved, indexed by the * given id. * - * Note: for pages associated with a view under an ion-nav-view, + * Note: for pages associated with a view under an ion-nav-view, * rememberScrollPosition automatically saves their scroll. * * Related methods: scrollToRememberedPosition, forgetScrollPosition (below). @@ -195,7 +195,10 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca * ``` * ```js * function ScrollCtrl($scope) { + * // Put any unique ID here. The point of this is: every time the controller is recreated + * // we want to load the correct remembered scroll values. * $scope.$ionicScrollController.rememberScrollPosition('my-scroll-id'); + * * $scope.$ionicScrollController.scrollToRememberedPosition(); * $scope.items = []; @@ -205,7 +208,7 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca * } * ``` * - * @param {string} id The id to remember the scroll position of this + * @param {string} id The id to remember the scroll position of this * scrollView by. */ this.rememberScrollPosition = function(id) {