DynamicJsonForm
dynamic-json-form@0.1.8 is the initial working version and update previous version if you had installed.
Steps to use
$3
npm i dynamic-json-form --save
$3
Write path of mustache to scripts array of angular.json
Eg. "scripts": [ "node_modules/mustache/mustache.min.js" ]
$3
Add angular-material theme in your global css file. By default in angular project it is styles.css
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
@import "~jsoneditor/dist/jsoneditor.min.css";
$3
Skip this if you use json file using http else Add this 2 properties into compiler options of tsconfig.json.
"compilerOptions" : {
"resolveJsonModule": true, "esModuleInterop": true
}
$3
Add this statement into your main module(by Default app.module.ts)
import {DynamicJsonFormModule} from 'dynamic-json-form';
Also import in imports array of NgModule.
$3
1. Build Form
[uiSchema]="uiSchema"
[errorSchema]="errorSchema">
2. Build Form Using Json Editor
[uiEditorData]="uiSchema"
[errorEditorData]="errorSchema">
where modelSchema, uiSchema, errorMessageSchema contain json file.