I have an SPA for job listings.  In the list view, the page is basically 3 
sections - I have a list section of all the jobs returned, a sidebar with 
filters to refine the search and paging at the bottom under the list.  A 
couple of things that I have to have for our customers who will eventually 
be using this is the ability for them to copy a url and send it to a friend 
and it also needs to work in IE9+.  What I would like to do is make it so 
that clicking a sidebar filter or page number only reloads the jobs but 
also changes the url so that it's a url people can copy/paste.

So, right now I have my sidebar filters set up to go to a url 
like 
http://localhost:3000/home#/jobs/page/1/pageSize/5?keyword=&location=&locationString=&salary=&positionTitle=&jobType=direct_hire&includeRemote=false
 
by constructing the url when a filter is clicked and then using 
$location.url to navigate to it.

This url returns a list of Direct Hire jobs which is what I want, but there 
are a couple of issues.  First off, in order to provide the copy/paste link 
for our clients I have to have this style url (as far as I can see) but 
because of this, it also reloads the filters and paging each time.  It 
would be ideal if it would only reload the list of jobs.  This leads me to 
thinking of a nested views type layout such as ui-router  or the new 
angular router (neither of which I've used yet).  But in the case of nested 
views would I be able to get the url structure I need?

Secondly, if I click on a job in this page, it takes me to a url 
like http://localhost:3000/home#/detail/10 which works fine.  But when I 
then click the back button I get this 
url 
http://localhost:3000/home#/detail/10?keyword=&location=&locationString=&salary=&positionTitle=&jobType=direct_hire&includeRemote=false
 
instead of 
http://localhost:3000/home#/jobs/page/1/pageSize/5?keyword=&location=&locationString=&salary=&positionTitle=&jobType=direct_hire&includeRemote=false
 
 I have to click a second time to get back to the original url.

So, would the new angular router or ui-router be able to provide me with 
the nested views AND a url structure like what I've shown?  What I really 
don't want to do is to have to set up routes like

page/:pageid/pageSize/:pageSize/jobType/:jobType/keyword/:keyword/etc....

That would require that every parameter be in a specific order right?  And 
also I'd have to create a number of different route combinations in case 
jobType or positionTitle weren't present, right?  Thanks.

-- 
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 angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to