mariohmol/ang-jsoneditor

Missing 'templates' option in JsonEditorOptions

Axinet opened this issue · 2 comments

Describe the bug
It looks like the 'templates' option is missing in the JsonEditorOptions class. It allows preparing predefined JSON parts to be easily inserted.

Expected behavior
JsonEditorOptions should have templates field allowing to set an array of "buttons" (text, title, className, field, value: any )

Screenshots
If applicable, add screenshots to help explain your problem.
Screen from JSONEditor options linked from README.
json-editor-settings

As whole settings object is forwarded to the underlying library, as for know it can be tricked with the following code:
let editorOptions: JsonEditorOptions = new JsonEditorOptions(); (<any>this.editorOptions).templates = [{menu options objects as in json editor documentation}]

Thanks @Axinet I included this workaround on the readme

the v1.9.0 includes this template and #58