pushstate - AngularJS: Keep track of user input in the URL so the user can take advantage of browser's back/forward -
angularjs's official tutorial great example of problem. when enter query , choose way sorts results @ http://angular.github.io/angular-phonecat/step-12/app/#/phones, url stays same , user output not stored anywhere else either. if user clicks link, can't go filtered results. more items , filters becomes annoying.
what best approach keeping user's filter selections , query in url? tried using combination of angularjs's $location
, $routeparams
, browser's history.pushstate()
, became quite cumbersome , things still don't work. reading 'organizing navigation' chapter of 'mastering web application development angularjs' book didn't either. there no single piece of code concerned about, whole structure of it.
just answered similar question else. can keep state value around.
see this plunker example. see this other question/answer.
Comments
Post a Comment