I am currently facing a challenge in extracting content from an editable div. I am having trouble incorporating the Angular template for this task.
The part that is posing a difficulty for me is figuring out how to link model data from the HTML template to the Angular controller.
<div ng-repeat="todo in todos">
<div class="todo.id" ng-model={{ ? }} contenteditable="true">
<pre>{{ todo.text }}</pre>
</div>
<button type="button" class="btn btn-link"
ng-click="editTodo(todo.id)">Edit</button>
</div>
My goal is to pass whatever text is present inside the
<div class="todo.id"></div>
Due to the fact that my div is within an ng-repeat, I am unable to assign ng-model to a single scope variable.
What should be inserted in place of "ng-model={{ ? }}"? Or is there a workaround for dealing with such a situation?
Your assistance in this matter would be greatly appreciated.