ng 单击未在 ng 对话框中触发



我在 NgDialog 内部有一个非常基本的 ng 单击,单击时不会触发,并且想知道有人对问题可能是什么有任何想法。

this.clickLocation = function () { ngDialog.open({ plain: true, controller: ['$scope', function ($scope) { console.log('hit'); }], template: '<div class="ngdialog-content">' + '<a ng-click="closeThisDialog()" class="button">Remove</a>' + '</div>' }); }

我真的无法重现您的错误,但我创建了以下 jsfiddle,一切都按预期工作: http://jsfiddle.net/bqbrLczc/5/

var myApp = angular.module('myApp',['ngDialog']);
function MyCtrl($scope, ngDialog) {
    $scope.clickToOpen = function () {
        ngDialog.open({ 
            plain: true,
            controller: ['$scope', function ($scope) {
                        console.log('hit');
            }],
            template: '<div class="test">'+ 
            '<a ng-click="closeThisDialog()" class="button">Remove</a>' + 
            '</div>' 
        });
    };
}

请检查您的代码中是否缺少任何内容,或者您是否使用的是旧的且可能有错误的版本。

最新更新