Angularjs怎样通过ui-router传参

2025-04-13 14:04:24
推荐回答(1个)
回答1:

.state('hello', { url: '/hello/{name}/{id}', templateUrl: 'views/name.html', }) conrtoller1:$state.go('hello',{name:'小明'},{id:1}) controller2:$stateParams.name和.id可以拿到controller1中传过来的值