我尝试实现模态窗口。我从网上找到了一些示例并实现了。
这里我添加了模式窗口的示例文件。运行良好。
我真正需要的是在打开模型窗口时调用此函数。
$scope.callType = {};
$scope.dataFormDialog = function (id) {
$scope.callType.id = id;
exDialog.openPrime({
scope: $scope,
template: '_Product.html',
controller: 'productController',
width: '450px',
//animation: false,
//grayBackground: false
});
};
这里我从sampleController调用_Product.html和productController。
模态窗口当时从sampleController调用。
如何将sampleController的$scope值传递给productController?
谁能帮我解决这个问题吗?...
最佳答案
试试这个
$scope.dataFormDialog = function (id) {
$scope.callType.id = id;
exDialog.openPrime({
template: '_Product.html',
controller: 'productController',
width: '450px',
resolve: {
Scopevariable: function () {
return $scope;
}
//animation: false,
//grayBackground: false
});
};
app.controller('productController', ["Scopevariable",
function (Scopevariable)
{
// use Scopevariable
}]);
关于javascript - 如何在AngularJS中将一个 Controller 的值传递给另一个 Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36003115/