angular ui router 当视图改变的时候url不会变,怎么让页面的url跟着一起变,急急急````
I have been looking for a long time but haven’t found a good method. I use window.location.href = ''
If you want to use the new features of html5, just set html5mode
ui-router的路由是基于状态的,不是基于url’s~
ui-router
url
ui.routerWhen the view changes, that means the state changes
ui.router
js.config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider .otherwise('/players?pagenum=1'); $stateProvider .state('players', { url: '/players?pagenum', templateUrl: 'tpls/players.html' }) .state('details', { url: '/details?playerId', templateUrl: 'tpls/details.html' }); });
js
.config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider .otherwise('/players?pagenum=1'); $stateProvider .state('players', { url: '/players?pagenum', templateUrl: 'tpls/players.html' }) .state('details', { url: '/details?playerId', templateUrl: 'tpls/details.html' }); });
I have been looking for a long time but haven’t found a good method. I use window.location.href = ''
If you want to use the new features of html5, just set html5mode
ui-router
的路由是基于状态的,不是基于url
’s~ui.router
When the view changes, that means the state changes