1

The onclick event on the return template doesn't do anything

{
    field: '',
    title: '',
    width: '80px',
    template: function (record) {
        return (
            '  <a href="javascript:void(0);" class="btn btn-xs btn-success margin-top-5 margin-bottom-5 btn-lg, btn-sucess"  ng-class="btnClass" ng-click="console.log(record)"> <span>Add</span> </a>'
        );
    }
},

Tried changing the string of the a tag, still unable to call ng-click method.

painotpi
  • 6,894
  • 1
  • 37
  • 70
Chris
  • 35
  • 4

1 Answers1

1

You have "javascript:void(0)" which is a function in JavaScript that returns undefined. When you click it it wont do anything. Just change href="#" Also update the ng-click to prevent default:

href="#" ng-click="$event.preventDefault();console.log(record)"

For more information: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void

Bozhinovski
  • 2,496
  • 3
  • 20
  • 38