路由設置(兩個State之間有父子關系):2.父State的控制器中的代碼:.controller("MyProfileCtrl", function ($scope, $state) {
$scope.goToMobileInput = function () {
$state.go("tab.my-profile-mobileinput", {"mobile": "123456"})
};
})3.子State的控制器中的代碼:.controller("MobileInputCtrl", function ($scope, $stateParams) {
alert($stateParams.mobile); // undefined})能夠跳轉到子State,但在子State的控制器中無法接收到參數(訪問參數時得到的結果是undefined,而非"123456")??戳司W上資料這么寫應該無誤,是跟State之間的父子關系有關嗎?
為什么我無法通過$stateParams在父子State之間傳遞參數?跟State之間的父子關系
慕姐4208626
2018-11-15 18:19:01