0

Use-case : User clicks on a button inside text angular textarea and applications angular function to be invoked Changes made : We had added ng-click, onclick events in textAngular-sanitize.js refer below screenshot

enter image description here

and added button in svgIcons variable

enter image description here

So that a button should get displayed and ng-click, onclick not to be stripped out. Button with the ng-click is rendered successfully but onclick of the button we need to call a angular function in our application.

Issues faced: The ng-click is not calling any function and we don't know under the hood how to make it work.

Pluker demo.

Unfortunately I am not able to make the plunker work but the code change is there what we are trying to achieve

James Z
  • 12,209
  • 10
  • 24
  • 44
Anand Kadhi
  • 1,790
  • 4
  • 27
  • 40

1 Answers1

0

I found that there is a event provided in text-angular for any of the tag type like the button I was asking in the question is actually a anchor tag.So I captured the anchor tag click by registering the event in taRegisterTool like below

taRegisterTool('yourWish', {

iconclass: "fa fa-xxxxx",

onElementSelect: {
  element: 'a',
  action: function(event, $element, editorScope){
    alert('Got the anchor tag selection event');       
}
}

});

Anand Kadhi
  • 1,790
  • 4
  • 27
  • 40