Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have an AngularJS web application which has similar functionality to DevHttpClient. Now I would like to have a possibility to have something similar to two-way binding between my model and <textarea/> element, so I could just pass a JSON entity object and it was parsed into my model. It should look something like this:

enter image description here

Whenever model values are updated - textarea is updated and vice versa.

HTML element, responsible for model output:

<div class="preview">
<p>Preview: </p> 
<textarea style="height:350px; width:550px; overflow:scroll;">{{createEntityResource | json}}</textarea>
</div>

Model is generated dynamicaly, so I guess there's no need to provide it's HTML. It's just simple input fields.

Any thoughts on how this can be achieved? Please, point me to the solution or provide some useful links / articles, express your own thoughts - every useful answer is highly appreciated and evaluated.

Thank you.

share|improve this question
    
Use the ng-model directive instead of the {{}}. See documentation –  callmekatootie Mar 31 '14 at 16:52
    
If I'd use simply ng-model, then the output will be just [Object object] –  Nazar Sobchuk Mar 31 '14 at 22:01
    
Can you paste the controller logic? ng-model will display what's in the model - so in your case, it mentions that the model is an object. Can't make out anything unless you post your controller logic that holds the value of the model. –  callmekatootie Apr 1 '14 at 6:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.