-
Notifications
You must be signed in to change notification settings - Fork 31
Plugins (e.g. SCEditor) config support #8
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
Comments
Hey sochka, I'm still trying to figure out how to work with sceditor, but i came across a solution that might be slightly more elegant for you. so something like this will work:
While it's still not the best idea to mix configuration with schema, It'll surely work better for you than configuring global variables. What do you think? |
It might be a good idea but not with my use case. It's actually other devs - users of my API who'll need to create schemas. I can't quite force them to set this property. |
There doesn't seem to be a smart way to configure JSONEditor without accessing globals,
It's still not ideal, as it's just accessing the global, but at least this will work until json-editor is updated with an easier functionality. Will this be acceptable? |
Maybe we should use providers, so we're able to use
Is it better from design point? For my personal use-case it's probably quite the same as what you suggest but later-on it might be easier to mock |
You can now inject JSONEditorProvider to your config, and configure JSONEditor using the JSONEditorProvider.configure() method. |
Thanks! Do you think it makes sense to have |
Added deep merge to JSONEditorProvider.configure #8
Since there is no use setting a different theme for every instance of JSONEditor on the page, I removed it, and now the configuration should be done through the JSONEditorProvider.configure method. |
Thanks, that's good. FYI, it's better to release this kind of breaking changes using major version updates. If somebody specified their dependency as |
Good call. |
Hi, how do I set plugin (e.g. SCEditor) options?
JsonEditorConfig.plugins.sceditor.style = /* url */
doesn't work because json-editor takes these properties from JSONEditor global object and in this lib JsonEditorConfig is manually merged into each instance config. The only (very hacky) solution I found is doing:in
angular.module(...).config
. Not even$window
because I can't use services in my config..The text was updated successfully, but these errors were encountered: