javascriptangularjsng-dialog

ng-click not firing within ngdialog


I have a very basic ng-click inside of an NgDialog that will not fire when being clicked on and was wondering anyone had any ideas on what the issue could be.

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>' }); }


Solution

  • I wasn't really able to reproduce your error, but I created the following jsfiddle with everything working as expected: 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>' 
            });
        };
    }
    

    Please check if theres anything missing from your code or if you're using a old and possibly bugged version.