用gulp压缩js时,ngDialog弹窗出错
出错的写法:
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();
}
}