未知提供程序:$modalProvider <- $modal <- 用户详细信息控制器



我想创建弹出窗口以发送电子邮件? 您确定要发送电子邮件是还是否?请帮助我解决 M 收到此错误未知提供程序:$modalProvider <- $modal <- 用户详细信息控制器。

define([
    'angular',
    './module'
], function (angular, module) {
    'use strict';
    module.controller('userDetailController', [
        '$scope',
        'userDetails',
        'navigationStateService',
        '$translate',
        'ngDialog',  
        function ($scope,userDetails,navigationStateService, $translate,ngDialog) {
            $scope.user = userDetails.getSelectedUser();

 $scope.openContactForm = function() {
                 var promise = modals.open(
                         "confirm",
                         {
                             message: "Are you sure you want to taste that?!"
                         }
                     );
                 promise.then(
                         function handleResolve( response ) {
                             console.log( "Confirm resolved." );
                         },
                         function handleReject( error ) {
                             console.warn( "Confirm rejected!" );
                         }
                     );
            };

试试$uibModal的,很简单,例子:

angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl', function ($scope, $uibModal, $log) {
  $scope.animationsEnabled = true;
//open modal
  $scope.open = function (size) {
    var modalInstance = $uibModal.open({
      animation: $scope.animationsEnabled,
      templateUrl: 'myModalContent.html',
      controller: 'ModalInstanceCtrl',
      size: size,
      resolve: {
        //resolve
      }
    });
    modalInstance.result.then(function (selectedItem) {
      //.then
    }, function () {
      $log.info('Modal dismissed at: ' + new Date());
    });
  };
  $scope.toggleAnimation = function () {
    $scope.animationsEnabled = !$scope.animationsEnabled;
  };
});

最新更新