1
當我將stateParams傳遞給另一個狀態時,它們與狀態連接並在IONIC應用程序中獲得以下結果。stateparms附帶當前狀態
var $currState = $ionicHistory.currentView().stateId;
$scope.consoleLog('$currState: ' + $currState); //$currState: app.stateA_purchaseData=[object Object]_supplierData=[object Object]"
$scope.consoleLog('$stateParams: ' + JSON.stringify($stateParams)); //$stateParams: {}
,這裏是
state('app.StateA', {
url: '/test-url',
templateUrl: 'templates/test.html',
controller: 'AppCtrl',
cache: false,
params: {
purchaseData: null,
supplierData: null,
}
})
$state.go('app.StateA', {purchaseData: $scope.purchaseData, supplierData: $scope.supplierData });
@Sarvan我得到這個錯誤 「」 類型錯誤:對象#