angular ui router - AngularJS not setting location state with "skipReload" -


i working on site transitioning angular - uses angular single page application navigation , new feature i'm working on written entirely in angular.

the rest of site takes navigation results , returns them through spa model, feature i'm working on runs entirely in single page, in order make links shareable , bookmarkable changes url in relation current state of page.

so when selects new subsection of new feature, have code in subsection service:

function setlocationforsubsection(subsection) {         var path = subsection.id ? "subsections/" + subsection.id + "/" + subsection.urlslug : "";         $location.path("/section/" + path).search({}).skipreload();     }; 

if follow link elsewhere in site ( goes through $stateprovider.state('all', { url: '*urlpath?id', controller... pattern ) works correctly.

if hit button, come correct page , setlocationforsubsection called. if click on same link outside of subsection again, nothing happens.

so course of action occurs:

  1. /section/2/subsection-name <- works.
  2. /news <- works
  3. back button ( /section/2/subsection-name ) <- works
  4. /news fails

as far can tell, problem arises because location path setting fails push location angular state in situation, far angular concerned still on /news , when try navigate there, doesn't pick navigation event. have tried using $window.history.pushstate(null, 'any', $location.absurl()); manually, doesn't seem make difference. if drop skipreload call works reloads contents of page, superfluous in case. i'm using approach now, know if there better option.

is there way tell angular state change has happened in case?


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -