-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to update json if there are multiple JSONeditor #40
Comments
Hi.. can u describe more this issue? the demo is working with 2 json editors with no issues |
if u still have this issue... let us know |
I have the same problem. If the there is multiple editors (created by ng-for loop) the events are not firing correctly. Always first editors parameters are passed to bound function of the event. |
please provide an stackblitz code or something to test this behavuour? |
Hi.. @osmanraifgunes with the #58 fixes this issue? can u make a demo with this behaviour so we can fix that? |
Here is the example : https://stackblitz.com/edit/ang-jsoneditor-easjts?file=src/app/app.component.html Both editors trigger event, but the data is always the first one's data. I think problem is the ang-jsoneditor module works as singleton. |
thanks for that info!! what u mean about working as singleton? do u have any ideas how to fix this? |
The thing here is about reusing the same editorOptions.. in you case what i did to fix was: <json-editor [options]="makeOptions()" [data]="prd" (change)="showJson($event)"></json-editor> makeOptions = () => {
return new JsonEditorOptions();
} |
I think solution is using @ViewChildren instead of @ViewChild. I asked this on stackof : https://stackoverflow.com/questions/60040466/angular-component-multiple-instance-binding-input-problem But doing so is writing this module whole again. |
I included this solution in the docs and in the demo app as well.. see if that works in your side |
Hi how can we add options when we use |
Hi you can add this way. Just updated the docs with it
|
No description provided.
The text was updated successfully, but these errors were encountered: