scttcper / ngx-codemirror

Codemirror Wrapper for Angular
https://ngx-codemirror.vercel.app
MIT License
282 stars 47 forks source link

Help: multiple editor on same screen have same state. #316

Closed dev-arminder closed 1 year ago

dev-arminder commented 1 year ago

Hi I am trying to use two differen editor on same URL ( same route). I had given them different ref and name. e.g image image

From TS File image Whenever I am trying to setValue of one element other get updated automatically. I want two different values for them.

Angular Version - 12 ngx-codemirror version - 5.1.1

lgpage commented 1 year ago

Hi @dev-arminder

It looks like your ngx-codemirror components are binding to the same model property obj. Try using different model properties, one for the first ngx-codemirror component and another for the second ngx-codemirror component.

dev-arminder commented 1 year ago

Oh Yeah @lgpage It works, but earlier I thinking to initialize with same value, updated value coming from API. I think i misunderstood [(ngModel)]. Btw thanks a lot @lgpage 👍