Skip to content
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

Add binding onChange in html #23

Closed
mebibou opened this issue Nov 29, 2018 · 2 comments
Closed

Add binding onChange in html #23

mebibou opened this issue Nov 29, 2018 · 2 comments

Comments

@mebibou
Copy link

mebibou commented Nov 29, 2018

Would it be possible to bind onChange on a component rather than the options? i.e. do the following:

<json-editor [options]="options" [data]="data" (change)="onChange($event)"></json-editor>

Because in my case I have a list of objects in which I want to edit for each a property as json, but the current way to bind events makes this very difficult. Actually the best would be to support [(ngModel)] like any other form control

@mariohmol
Copy link
Owner

thats a good idea.. you know how to bind (change) and [(ngModel)]?

check it out https://github.com/mariohmol/ang-jsoneditor/blob/e14e8309b4e9d4332fb7f5194885a81d3ac576ed/ang-jsoneditor/src/jsoneditor/jsoneditor.component.ts

@mariohmol
Copy link
Owner

Check it out the version 1.7.0

<json-editor [options]="editorOptions" [(ngModel)]="data" (change)="getData($event)"></json-editor>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants