I'm currently facing an issue with adding the ng-click
directive to a button. Here's my HTML:
<button class="btn">clicky</button>
This is the directive I am using:
angular.module('app').directive('btn', function() {
return {
restrict: 'C',
replace: true,
scope: true,
transclude: true,
template: '<button ng-click="onClick()"></button>'
};
});
The issue I am facing is that it removes the text "clicky" from the button element.
Even after trying to use transclude, the problem persists. Any help or suggestions would be greatly appreciated. Thank you.