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

1 Answer 1

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

});

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.