I have an app that loads a list view of up to 100 user profiles as the
default view. Clicking on one of the profiles navigates to the detail
view for that profile.
The default/list view is: /query#!/list
The detail view is: /query#!/<profile-id>/main
I have added an anchor tag to each list item in the list view that is
<prefix>+<profile-id>
Let's say the prefix is 'pid'
I am using angular 0.10.5 and the $route service.
If the user navigates to a profile detail view from the 80th item (let's
say profile id 1001) in the list and then returns to this list (by
either clicking a "Return" button in the UI or by using the browser back
button) I want the list to scroll to the 'pid1001' anchor inside the
list view (route)
I've unsuccessfully tried 2 approaches and I've also noticed some
unreleased code in the trunk that looks like it might address this issue?
How can I implement this this week? If I wait for 0.10.6 will this be
easier?
Thanks,
Sean
I'm not sure I understand how your hack would apply to my situation.
I'm using the $route service and the ng:view and ng:include tags. I
want $route to change the view and then scroll to an element within the
new view.
-- Sean
I see in the trunk code there is an $autoScroll service that looks at
first glance like it might do what I need. Should I try to build and
use this, should I wait for the next release (especially if it is coming
soon), or is there something else I can do?
Exactly.
> This feature has already been implemented for both ng:view and
> ng:include,
> see https://github.com/vojtajina/angular.js/blob/master/src/service/autoScroll.js
I briefly looked at the code and I thought it does what I'm looking for. :)
> Guess what, it's in the master, but not released yet...
So, what are my options?
I can think of two:
a) Make my own build - how easy is that? - can I get a stable
version that way?
b) Wait for 0.10.6 - is it coming soon? - any estimate of a release
date?
Any other ideas?
-- Sean