Stalder2017-08-21 16:09:42
Stalder, 2017-08-21 16:09:42

AngularJS. How to remove all tags from textbox on div with contenteditable?

Task: by clicking on the button, remove all tags from the field. With input, you could use the ng-model directive and dance from it, but the div didn't like this idea. How to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0X12eb, 2017-08-21

1. Custom attribute directive for the button, which will find the element.parent of interest to the div, and with the help of jqLite you will do anything with the found container.
2. If the case is unique, then we hang all of the above on the usual ng-click for the button.

Nicholas, 2017-08-21

The best way to do this is through ng-model.
Those. make a directive that uses ng-model and its parsers/formatters.
Including it will be possible to delete and at each change of model, not only by the button.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question