我为错误,警告开发了常见的警报模式,并使用角度基础模式确认。我的问题是,我不能将变量传递给模态。模态内容:
<h3 class="caps">{{ alertmessage }}</h3>
<p>{{ alertdetail }}</p>
开放警报服务:
appCommonServiceModule.factory('AlertModalService' , function($modal ,$rootScope){
function AlertModalService(){
this.openAlertModal = function($scope,type ,message , detail , successCallback ,cancelCallback ){
var templateUrl = ASSETS_PATH+'app/pages/templates/alert/';
var className = "reveal-modal small alert-modal ";
if(type == "SUCCESS"){
templateUrl = templateUrl+"success.html";
className += "success-modal"
}
$scope.message = message;
$scope.detail = detail;
var modalInstance = $modal.open({
templateUrl : templateUrl,
controller : 'AlertBaseController',
backdrop: 'static',
windowClass:className,
scope:$scope,
resolve : {
alertmessage: function(){
return $scope.message;
},
alertdetail :function(){ return $scope.detail;
}
}
});
modalInstance.result.then(function(){
if(successCallback){
successCallback();
}
},function(){
if(cancelCallback){
cancelCallback();
}
});
}
}
return new AlertModalService();
});
我找不到解决方案。
感谢您的帮助