点击按钮,它不会影响AngularConfirm

时间:2017-06-10 06:58:58

标签: angularjs

单击按钮时,它不会弹出angularConfirm对话框窗口。由于我是angularJS材料的新手,我无法理解实际问题所在。请帮助我。

     Html Code:

   <md-button class="md-raised next-btn" ng-click="showConfirm()">join 
   group</md-button>


 Script file:
<script>


         angular.module('myapp', ['ngMaterial'])

 .controller('headcontroller', function($scope,$http,$window,$mdDialog) {
   $scope.status = '  ';
   $scope.customFullscreen = false;

    $scope.showConfirm = function(ev) {

      var confirm = $mdDialog.confirm()
           .title('Would you like to delete your debt?')
           .textContent('All of the banks have agreed to forgive you your 
       debts.')
          .ariaLabel('Lucky day')
           .targetEvent(ev)
            .ok('Please do it!')
            .cancel('Sounds like a scam');

       $mdDialog.show(confirm).then(function() {
        $scope.status = 'You decided to get rid of your debt.';
         }, function() {
          $scope.status = 'You decided to keep your debt.';
      });
    };



    });


    </script>

0 个答案:

没有答案