mariohmol / ang-jsoneditor

Angular Jsoneditor that works with angular 4 to angular 15

Home Page:https://stackblitz.com/edit/angular-json-editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing 'templates' option in JsonEditorOptions

Axinet opened this issue · 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