-1
我正在使用角度UI状态路由器使用此示例: http://plnkr.co/edit/IzimSVsstarlFviAm7S7?p=preview。路由器看起来像这样有每个国家不同的URL:如何在不更改URL的情况下使用UI路由器?
// HOME STATES AND NESTED VIEWS ========================================
.state('home', {
url: '/home',
templateUrl: 'partial-home.html'
})
// nested list with custom controller
.state('home.list', {
url: '/list',
templateUrl: 'partial-home-list.html',
controller: function($scope) {
$scope.dogs = ['Bernese', 'Husky', 'Goldendoodle'];
}
})
// nested list with just some random string data
.state('home.paragraph', {
url: '/paragraph',
template: 'I could sure use a drink right now.'
})
// ABOUT PAGE AND MULTIPLE NAMED VIEWS =================================
.state('about', {
url: '/about',
views: {
'': { templateUrl: 'partial-about.html' },
'[email protected]': { template: 'Look I am a column!' },
'[email protected]': {
templateUrl: 'table-data.html',
controller: 'scotchController'
}
}
});
我想实现的UIrouter不改变网址:此刻当我改变状态的URL发生变化。假设我正在创建一个页面,我必须添加一个参数,如何传递参数?
使用路由器做什么?问题不完整 – charlietfl
你想用ui-router做什么? – maddygoround
@charlietfl我想将参数从1状态传递给另一个状态?我必须使用广播服务还是可以使用UI路由器呢? – Leeuwtje