AngularJS如何打开模态弹出窗口

时间:2015-10-01 20:21:49

标签: angularjs

您好我是AngularJS的新手,我无法弄清楚如何打开模态对话框。它让我疯了!谁能告诉我我做错了什么?我的控制器代码如下:

更新代码:

buttonh:

{{1}}

plunker链接:Option.fold

2 个答案:

答案 0 :(得分:0)

https://likeastore.github.io/ngDialog/

查看ngDialog

Web应用程序中的对话框与桌面应用程序中的对话框略有不同,边缘情况很多。 ngDialog在一个不错的软件包中很好地解决了许多这些问题。

答案 1 :(得分:0)

angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl', function ($scope, $modal, $log) {

  $scope.items = ['item1', 'item2', 'item3'];

  $scope.animationsEnabled = true;

  $scope.open = function (size) {

    var modalInstance = $modal.open({
      animation: $scope.animationsEnabled,
      templateUrl: 'myModalContent.html',
      controller: 'ModalInstanceCtrl',
      size: size,
      resolve: {
        items: function () {
          return $scope.items;
        }
      }
    });

    modalInstance.result.then(function (selectedItem) {
      $scope.selected = selectedItem;
    }, function () {
      $log.info('Modal dismissed at: ' + new Date());
    });
  };



});
相关问题