对于按钮单击,我有以下代码。一旦按下按钮,它就会加载离子弹出窗口并填充一些数据。
$scope.bettingGroupingOptions = bettingOption;
var alertPopup = $ionicPopup.alert({
title: bettingOption.betName + ' ' + bettingOption.length + 'x',
scope: $scope,
templateUrl: 'templates/grouping_combo_selections.html'
});
alertPopup.then(function(res, bettingOption) {
console.log(bettingOption);
//console.log("BETTING AMILA : " + bettingOption);
//console.log("DOUBLE BETNAMES : " +$scope.doubleBetNames);
//console.log("BET NAME : " + $scope.bettingDoubleOption.betName);
// console.log("DOUBLE BETNAMES ALL : " +$scope.doubleBetNames.betName);
//console.log("Multiflier : " +bettingDoubleOption.multiplier);
});
Popup被加载但不幸的是数据不存在。任何人都可以帮我解决这个问题。数据在这个变量“$ scope.bettingGroupingOptions”中但是在弹出窗口中没有反映出来。
感谢。
答案 0 :(得分:0)
此承诺成功函数中没有第二个参数,将bettingOption
放在那里使得此变量未定义:
$scope.bettingGroupingOptions = bettingOption;
var alertPopup = $ionicPopup.alert({
title: bettingOption.betName + ' ' + bettingOption.length + 'x',
scope: $scope,
templateUrl: 'templates/grouping_combo_selections.html'
});
});
alertPopup.then(function(res) {
console.log(bettingOption);
});