我使用https://github.com/simpulton/angularjs-wizard作为我的项目,它有效,
(我对其进行了一些修改,将var app
替换为$scope
)
但我需要将变量传递给open
函数:
$scope.open = function (image)
{
$scope.image = image;
var modalInstance = $uibModal.open({
templateUrl: 'wizard.html',
controllerAs: 'modal',
size: 'lg',
controller: 'ModalCtrl',
resolve: {
image: function () {
return image;
}
}
});
modalInstance.result
.then(function (data) {
$scope.closeAlert();
$scope.summary = data;
}, function (reason) {
$scope.reason = reason;
});
};
并在html中:
ng-click="open(image)"
但我的模板中image
为undefined
如果我只使用模态窗口,并使用https://angular-ui.github.io/bootstrap/#/modal中的示例,它就有效 但不是这个向导的例子
更新
https://jsfiddle.net/Ginstay/znz64sk3/2/
是的,当我打开模态窗口时,ajax就完成了如果我向return image;
图片添加断点,那么
答案 0 :(得分:4)
试试这个
txt1 * ddl1 = ((txt2 * ddl2) + (txt3 * ddl3) + (txt4 * ddl4))
答案 1 :(得分:1)
我想,我需要添加
angular.module('plunker', ['ui.bootstrap']);
var ModalDemoCtrl = function ($scope, $modal) {
var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
controller: ModalInstanceCtrl,
resolve: {
test: function () {
return 'test variable';
}
}
});
};
var ModalInstanceCtrl = function ($scope, $modalInstance, test) {
$scope.test = test;
};
到$scope.image = image;