See this issue:
https://github.com/angular/angular.js/issues/4691
Basically I want to be able to bind an object to a contenteditable div, and having two way binding.
The object can be like:
{
title: 'Post title',
paragraphs: ['Paragraph 1', 'Paragraph 2']
}
This should be parsed before binding to the element and be formatted as:
<div class="title">Post title</div>
<div class="paragraphs">
<p>Paragraph 1</p>
<p>Paragraph 2</p>
</div>
This is one way binding, from the model to the view. Now I need also support binding from the view to the model, using a parser to the HTML string and applying it to the original model. Something like:
ngModel.$setModelValue(value){
// No need to show here the parsing code. This is an example, which hard coded text:
ngModel.$modelValue.titile = 'new edited title',
ngModel.$modelValue.parahraphs = ['Paragraph 1 edited', 'New paragraph 2'];
}
Can anyone help me modify the AngularJS code to support this, so we can have a nice PR with this feature?