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

AngularJS directive for this? #192

Closed
minutephp opened this issue May 13, 2015 · 8 comments
Closed

AngularJS directive for this? #192

minutephp opened this issue May 13, 2015 · 8 comments

Comments

@minutephp
Copy link

Hi,

I think this is the best JSON editor library. But since my app is using AngularJS I was wondering if there is a AngularJS directive for using this?

When I search Google for jsoneditor angularjs I stumble upon other libraries but nothing relevant to what I'm looking for..

I'm sure I can write the directive myself (I guess all that is needed is to add ngModel support) but I don't want to re-invent the wheel, so just want to make double sure something like this already doesn't exist?

Thanks.

@josdejong
Copy link
Owner

Thanks. As far as I know there is no angular directive for the JSONEditor. It would be great if you could make one, I could add a link to your directive in the readme of JSONEditor for example.

@minutephp
Copy link
Author

Thanks for the quick reply. I will do that and send a link to you soon :)

@angular-tools
Copy link

Hi,

I've created the directive here: https://github.com/angular-tools/ng-jsoneditor

The demo can be found here:
http://jsfiddle.net/angulartools/sd3at5ek/

Please check..

thanks :)

@josdejong
Copy link
Owner

Nice! I've added a link to the directive in the Readme of JSON Editor: https://github.com/josdejong/jsoneditor#install

It may be useful to add an (optional) delay between the changes in the JSONEditor and applying it to Angular. For larger JSON objects it could become expensive to retrieve and process the whole document with every character you type.

@angular-tools
Copy link

Thanks. You are right about that. How much delay would you suggest?

Actually I think I'll set it to 250ms and make it a configurable option

@josdejong
Copy link
Owner

I think 205 ms would be fine. And when it's configurable there is no problem at all :)

@wagnermonteverde
Copy link

Hi! How to block fields for edition with the directive.
Thanks!

@josdejong
Copy link
Owner

@wagnermonteverde I think you can best ask this in the concerning project:

https://github.com/angular-tools/ng-jsoneditor

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

4 participants