javascript - angular ui router back button issue -


'use strict';  angular.module('cbapp')   .config(function ($stateprovider) {     $stateprovider       .state('search', {         url: '/college/search',         templateurl: 'app/collegesearch/views/collegesearch.html',         controller: 'collegesearchctrl'       })        .state('searchcollegefilter', {         url: '/college/search/:streamid?cities&courses&branches&ordering',         templateurl: 'app/collegesearch/views/collegesearch.html',         controller: 'collegesearchctrl'       });    }); 

here application calls 1st state i.e 'search' url /college/search. inside controller transition state searchcollegefilter. wanna navigate user back came when click browser button. came '/' want them go home page. in browser history there 2 entries college/search. want happen 1st time.

for northing angularjs, thing need watch browser event before navigating "window.onhashchange". observing can make check , can redirect default page


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -