Open bhattaca72 opened 7 years ago
exact same problem here
FYI I worked around it with adding *ngIf="schema !== undefined" in the HTML, and private schema:any; in the ts code example:
private schema:any;
<sf-form [schema]="schema" [model]="model" [validators]="fieldValidators" [actions]="actions" *ngIf="schema !== undefined"></sf-form>
The correct issue here is that the FormComponent's ngOnChanges
will throw an error if it is called and this.schema
is null or undefined, which will happen if the schema is unavailable when the component is first initialized.
This is the line with the issue: https://github.com/makinacorpus/angular2-schema-form/blob/master/src/form.component.ts#L76
The same issue is already mentioned by #42 .
Form renders fine when read from a file. However fails when tried with the response of the http call..
the file that renders fine is attached is as, the http response is verified to be same.
{"properties":{"userID":{"type":"string","minLength":7,"maxLength":10,"description":"User ID"},"appID":{"type":"string","minLength":3,"maxLength":3,"description":"Application Identifier"}},"required":["userID"]}
Any heads up if anything specific is missing out?