出错的写法:

ngDialog.open({
            template : 'html/**.html',
            className : 'ngdialog-theme-plain',
            width : '60%',
            scope : $scope,
            cache : false,
            controller :function($scope){
                $scope.closeThisDialog();
            }
        }

正确的写法:(controller里不需要再定义$scope)

ngDialog.open({
            template : 'html/**.html',
            className : 'ngdialog-theme-plain',
            width : '60%',
            scope : $scope,
            cache : false,
            controller :function(){
                ngdialog.close();
            }
        }

当弹窗比较多的时候,建议为每一个弹窗命名:

var dialogView = ngDialog.open({
    template : 'html/**.html',
    className : 'ngdialog-theme-plain',
    width : '60%',
    scope : $scope,
    cache : false,
    controller :function($scope){
        dialogView.close();
    }
}

 

ngDialog.open({
template : 'html/**.html',
className : 'ngdialog-theme-plain',
width : '60%',
scope : $scope,
cache : false,
controller :function($scope){
$scope.closeThisDialog();
}
}

相关文章:

  • 2021-07-04
  • 2021-05-05
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-11
  • 2021-11-10
  • 2021-06-28
  • 2022-12-23
  • 2021-05-03
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案