angular ui router 当视图改变的时候url不会变,怎么让页面的url跟着一起变,急急急````
我也找了很久没找到好的方法,用的window.location.href = ''
如果想用html5的新特性就设置html5mode
ui-router的路由是基于状态的,不是基于url的~
ui-router
url
ui.router视图改变,那就是state改变咯
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' }); });
我也找了很久没找到好的方法,用的window.location.href = ''
如果想用html5的新特性就设置html5mode
ui-router
的路由是基于状态的,不是基于url
的~ui.router
视图改变,那就是state改变咯