I have a button in my directive that is supposed to open a configuration ngDialog.
Here is my code for theme.html directive:
<div class="col-lg-3 col-md-6"> <div class="panel panel-{{colour}}"> <div class="panel-heading"> <div class="row"> <div class="col-xs-3"> <i class="fa fa-{{type}} fa-5x"></i> </div> <div class="col-xs-9 text-right"> <div class="huge">{{name}}</div> <div>{{comments}}</div> </div> </div> </div> <div class="panel-footer"> <div class="ngdialog-buttons btn-toolbar"> <button type="button" ng-dialog-controller="MainCtrl" class="ngdialog-button btn btn-primary pull-right" ng-click="openConfigWindow('theme')">Settings</button> </div> <div class="clearfix"></div> </div> </div> </div> theme.js
angular.module('adminApp') .directive('theme',function() { return { templateUrl:'scripts/directives/theme/theme.html', restrict:'E', replace:true, scope: { 'model': '=', 'comments': '@', 'name': '@', 'colour': '@', 'details':'@', 'type':'@', 'goto':'@', 'status':'@' /*hooking this event invokes the ngClick, but not on the button*/ //eventHandler: '&ngClick' } } }); Here is how theme directive is used in html:
<div class="panel-body" data-ng-controller="MainCtrl"> <theme name="test" comments="New comments!" colour="info" type="sample" status="Deactivate"></theme> </div> main.js contains the MainCtrl controller:
angular.module('adminApp') .controller('MainCtrl', function($scope,$position,$rootScope, ngDialog) { $scope.openConfigWindow = function (themeName) { $rootScope.theme = themeName; ngDialog.open({ template: '/views/configPopup.html', controller: 'InsideCtrl', className: 'ngdialog-theme-default dialogDimension', closeByDocument: false }); }; }) openConfigWindow is not invoked, how should I bind ng-click to the button inside my theme directive?