I have AngularJS application, which collects data from input, transforms model into string using JSON.stringify()
and lets a user edit this model in such way that input fields get updated if the <textarea>
element is updated and vice versa. Some kind of two-way binding :)
The problem is that the String itself looks ugly and I would like to format it so it looks like this:
And not like it looks now:
Any ideas how this can be acomplished? If you need some additional info - don't hesitate asking. Every answer is highly appreciated and answered immidiately.
Thank you.
P.S. I guess this should be some kind of directive or a custom filter. Data itself SHOULD NOT be changed, only the output.
$watch
(based on the answer to previous question) over the textarea model, can you do aconsole.log()
and see what value you get in the string for the enter key - I think it's "/n" – callmekatootie Apr 1 '14 at 12:29