Can someone explain the unexpected state transition using the ui-router and back buttons?

I am using ui-router with nested states / views and I have a problem with the back button.

State hierarchy

  • product
    • personal
      • sub-cat-1
      • sub-cat-2
    • business
      • sub-cat
      • sub cat b
  • Search

Problem

First, I load the page into state product.business.sub-cat-a. On the top level page there is an input form for searching, which when used causes a state to transition to a state search(via a call $state.go()), which everything works fine.

, "", search product.business.sub-cat-a, ( $state.transitionTo()), $state.go() search, , .

, - , u-router

Update

urlRouter $location. , $urlRouter.update url, stat, $location - $location.

, , urlRouter - URL-, $location.url urlRouter , , .

, :

  • URL
  • ui-router ( )
  • update urlRouter ( ), $location reset URL- urlRouter
  • urlRouter URL/ , , $location.url, URL-

, , urlRouter , 3 .

ui-router/ angular, , .

+4
1

, , , "" . , ""; - $state.go(), (-), .

, promises, resolve. , urlRouter $urlRoute.udpate(), .

, - : -)

+1

All Articles