angular.js - angualr ui router 如何改变url
phpcn_u1582
phpcn_u1582 2017-05-15 16:53:11
0
4
616

angular ui router 当视图改变的时候url不会变,怎么让页面的url跟着一起变,急急急````

phpcn_u1582
phpcn_u1582

reply all(4)
曾经蜡笔没有小新

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

过去多啦不再A梦

ui-router的路由是基于状态的,不是基于url’s~

左手右手慢动作

ui.routerWhen the view changes, that means the state changes

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'
        });
});
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template