民间,
我使用Angular ui $ modal来创建模态。 当我尝试使用resolve将数据传递给模态时,我遇到了各种错误。有人能指出我正确的方向吗?
// Manage Views
$scope.openProductListModal = function() {
var modalInstance = $modal.open({
templateUrl: 'products/manageProductList.tpl.html',
controller: 'ManageProductListCtrl',
resolve: {
userpref: function() {return $scope.user.prefrences;};
cartSelection: function() {return return $scope.user.cart;};
prevSelects:function() {return $scope.prev.selects;}
}
});
};
答案 0 :(得分:0)
您的代码中存在一些语法错误。
;
,
字符
return
cartSelection
语句
像这样:
// Manage Views
$scope.openProductListModal = function() {
var modalInstance = $modal.open({
templateUrl: 'products/manageProductList.tpl.html',
controller: 'ManageProductListCtrl',
resolve: {
userpref: function() {return $scope.user.prefrences;},
cartSelection: function() {return $scope.user.cart;},
prevSelects:function() {return $scope.prev.selects;}
}
});
};