我需要把我的回复转到另一页。
这是我的第一页函数。检查这个
$scope.runAnswer = function () {
const data = {
schType: $scope.screenList.sched,
frequency: $scope.screenList.freq ? $scope.screenList.freq : '',
screeningArr: array
};
console.log(data);
$http({
method: "POST",
url: appConfig.apiUrl + "/screening/run",
data: data
}).then(function (response) {
$scope.screeningList = response.data.screeningArr;
$state.go('app.customer-list-screen-view', { benefit: $scope.screeningList });
}, function (response) {
$log.log(response);
angular.forEach(response.data.errors, function (error, index) {
alertService.error(error.message);
});
$scope.alerts = alertService.get();
});
};
在我尝试访问第二页控制器中传递的对象之后。
这是我的第二页代码。我正在尝试访问它。但没有起作用。这是我这期的样本。
.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('app.customer-list-screen-view', {
url: '/customer-list-screen-view/:benefit ',
templateUrl: 'modules/customer-list-screen-view/customer-list-screen-view.html',
controller: 'customerListScreenViewCtrl'
});
}])
我正在尝试使用以下代码访问
$scope.categoryId = $stateParams.benefit;
console.log($scope.categoryId);
但控制台日志显示如下[对象对象],[对象对象],[对象对象对象]
如何正确传递此对象?
暂无答案!
目前还没有任何答案,快来回答吧!