0

I display JSON in pre tag using json pipe. Unfortunately when I edit JSON I don't see changes in value variable so how can I bind these values?

<pre contenteditable="true">{{value | json}}</pre>
AKZB
  • 157
  • 1
  • 12

2 Answers2

1

MAybe have you tried something like:

<input type="text" col="5" [(NgModel)]="value" />

<pre contenteditable="true">{{value | json}}</pre>

So put your json in a text area with a bind on your value?

Hope it helps you!!

federico scamuzzi
  • 3,708
  • 1
  • 17
  • 24
0

I used <textarea> instead of <pre> and it solved my problem :)

AKZB
  • 157
  • 1
  • 12