这是我一个页面的路由配置
$stateProvider.state('main', {
url: '/main/:page',
templateUrl: 'view/main.html',
controller: 'mainCtrl'
});
给页面传递参数后可以正常访问:
http://localhost:8000/#!/main/1
http://localhost:8000/#!/main/2
...
可是我想配置一种不传递任何参数的默认情况
比如直接访问 http://localhost:8000/#!/main
已解决。。。
参数配置变为如下就可以了:
url: '/main?page',