在模态窗口中ng-click不起作用

时间:2015-01-07 20:39:25

标签: javascript angularjs modal-dialog

我将Magnificent Popup与Angular结合使用。

当模态窗口由常规链接触发时,它工作得很好,但是当我尝试动态打开模态时,对它的ng-click不起作用。我点击按钮没有任何反应,甚至没有错误消息。

HTML:

<div class="white-popup mfp-hide" id="saved-game-modal">
    <p>Would you like to continue your saved game?</p>
    <button ng-click="continueGame()">Yes</button>
    <button onclick='jQuery.magnificPopup.close()'>No</button>
</div>

JavaScript的:

myController.controller('myController',['$scope', function($scope) {

   jQuery.magnificPopup.open({
       items : {
         src: '#saved-game-modal'
       },
       type: 'inline'
   }, 0);

   $scope.continueGame = function() {
      alert('here');

   };
}]);

如何使角度代码在其上工作?

这里是小提琴: http://jsfiddle.net/w544vpfu/14/

0 个答案:

没有答案