dist/@ajsf/core/esm2015/lib/json-schema-form.component.js
/**
     * 'initializeForm' function
     *
     * - Update 'schema', 'layout', and 'formValues', from inputs.
     *
     * - Create 'schemaRefLibrary' and 'schemaRecursiveRefMap'
     *   to resolve schema $ref links, including recursive $ref links.
     *
     * - Create 'dataRecursiveRefMap' to resolve recursive links in data
     *   and corectly set output formats for recursively nested values.
     *
     * - Create 'layoutRefLibrary' and 'templateRefLibrary' to store
     *   new layout nodes and formGroup elements to use when dynamically
     *   adding form components to arrays and recursive $ref points.
     *
     * - Create 'dataMap' to map the data to the schema and template.
     *
     * - Create the master 'formGroupTemplate' then from it 'formGroup'
     *   the Angular formGroup used to control the reactive form.
     */


- Create 'schemaRefLibrary' and 'schemaRecursiveRefMap'
to resolve schema $ref links, including recursive $ref links.

- Create 'dataRecursiveRefMap' to resolve recursive links in data
and corectly set output formats for recursively nested values.

- Create 'layoutRefLibrary' and 'templateRefLibrary' to store
new layout nodes and formGroup elements to use when dynamically
adding form components to arrays and recursive $ref points.

- Create 'dataMap' to map the data to the schema and template.

- Create the master 'formGroupTemplate' then from it 'formGroup'
the Angular formGroup used to control the reactive form.
- Create ' schemaRefLibrary ' and ' schemaRecursiveRefMap ' to resolve schema $ref links including recursive $ref links . - Create ' dataRecursiveRefMap ' to resolve recursive links in data and corectly set output formats for recursively nested values . - Create ' layoutRefLibrary ' and ' templateRefLibrary ' to store new layout nodes and formGroup elements to use when dynamically adding form components to arrays and recursive $ref points . - Create ' dataMap ' to map the data to the schema and template . - Create the master ' formGroupTemplate ' then from it ' formGroup ' the Angular formGroup used to control the reactive form .
initializeForm() {
        if (this.schema || this.layout || this.data || this.form || this.model ||
            this.JSONSchema || this.UISchema || this.formData || this.ngModel ||
            this.jsf.data) {
            this.jsf.resetAllValues(); 
            this.initializeOptions(); 
            this.initializeSchema(); 
            this.initializeLayout(); 
            this.initializeData(); 
            this.activateForm(); 
            if (this.debug || this.jsf.formOptions.debug) {
                const vars = [];
                this.debugOutput = vars.map(v => JSON.stringify(v, null, 2)).join('\n');
            }
            this.formInitialized = true;
        }
    }
initializeForm ( ) { if ( this . schema || this . layout || this . data || this . form || this . model || this . JSONSchema || this . UISchema || this . formData || this . ngModel || this . jsf . data ) { this . jsf . resetAllValues ( ) ; this . initializeOptions ( ) ; this . initializeSchema ( ) ; this . initializeLayout ( ) ; this . initializeData ( ) ; this . activateForm ( ) ; if ( this . debug || this . jsf . formOptions . debug ) { const vars = [ ] ; this . debugOutput = vars . map ( v => JSON . stringify ( v , null , 2 ) ) . join ( '\n' ) ; } this . formInitialized = true ; } }
'initializeForm' function
 - Update 'schema', 'layout', and 'formValues', from inputs.
' initializeForm ' function - Update ' schema ' ' layout ' and ' formValues ' from inputs .
// Reset all form values to defaults // Update options // Update schema, schemaRefLibrary, // schemaRecursiveRefMap, & dataRecursiveRefMap // Update layout, layoutRefLibrary, // Update formValues // Update dataMap, templateRefLibrary, // formGroupTemplate, formGroup // Uncomment individual lines to output debugging information to console: // (These always work.) // console.log('loading form...'); // console.log('schema', this.jsf.schema); // console.log('layout', this.jsf.layout); // console.log('options', this.options); // console.log('formValues', this.jsf.formValues); // console.log('formGroupTemplate', this.jsf.formGroupTemplate); // console.log('formGroup', this.jsf.formGroup); // console.log('formGroup.value', this.jsf.formGroup.value); // console.log('schemaRefLibrary', this.jsf.schemaRefLibrary); // console.log('layoutRefLibrary', this.jsf.layoutRefLibrary); // console.log('templateRefLibrary', this.jsf.templateRefLibrary); // console.log('dataMap', this.jsf.dataMap); // console.log('arrayMap', this.jsf.arrayMap); // console.log('schemaRecursiveRefMap', this.jsf.schemaRecursiveRefMap); // console.log('dataRecursiveRefMap', this.jsf.dataRecursiveRefMap); // Uncomment individual lines to output debugging information to browser: // (These only work if the 'debug' option has also been set to 'true'.) // vars.push(this.jsf.schema); // vars.push(this.jsf.layout); // vars.push(this.options); // vars.push(this.jsf.formValues); // vars.push(this.jsf.formGroup.value); // vars.push(this.jsf.formGroupTemplate); // vars.push(this.jsf.formGroup); // vars.push(this.jsf.schemaRefLibrary); // vars.push(this.jsf.layoutRefLibrary); // vars.push(this.jsf.templateRefLibrary); // vars.push(this.jsf.dataMap); // vars.push(this.jsf.arrayMap); // vars.push(this.jsf.schemaRecursiveRefMap); // vars.push(this.jsf.dataRecursiveRefMap);