http://localhost/shop#/item/1000
I want to change it to http://localhost/shop#item-1000
I use $stateProvider
.state('item', {
url: '/item/:id',
templateUrl: "/ionic/templates/item.html",
controller:'ItemShowController'
})
The above has also been changed. Changing it to url: 'item-:id',
is useless
黄舟2017-05-15 17:04:49
First generally #
之前的路由是后端提供的,#
之后的路由是由Angular
控制的;#
表明整个应用使用的是Angular
default hash routing. If you want to change it to what you want, you can try this:
.state('item', {
url: '/item-{id}', // 这里这样写路由
templateUrl: "/ionic/templates/item.html",
controller:'ItemShowController'
})
This should be fine