Hi,
from ng repeat items, I can click on each item and it will bring detailed
page. Then from a back button, I get back to ng repeat, and to preserve
state, I inject values saved in a service back in controller to see the
same ng repeat I left when jumping to detailed page. Here is what I have in
controller:
$scope.query = fieldValues.query;
$scope.catFilter = fieldValues.catFilter;
$scope.setCat = fieldValues.catFilter;
$scope.isFav = fieldValues.isFav;
$scope.change();
if (fieldValues.myoffset) {
setTimeout(function () {
window.scrollTo(0, fieldValues.myoffset);
},2000);
}
Problem I have is with the scrollto function: i'm forced to set a timeout
to delay it, if not it won't be correctly processed.
I would like to know this please:
Is there a way to encapsulate all the $scope lines into some kind of delay
/ defer / promise feature, so that after all of the $scope assignments are
over, then it would process the window.scrolltTo function, thus without the
need of the timeout thing.
How ?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.