Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

[BUG] Form not generated if reading from json file #69

Closed
1 of 2 tasks
weihan1394 opened this issue Apr 10, 2020 · 1 comment
Closed
1 of 2 tasks

[BUG] Form not generated if reading from json file #69

weihan1394 opened this issue Apr 10, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@weihan1394
Copy link

weihan1394 commented Apr 10, 2020

Environment

Please provide as many details as you can:
I will like to generate the form using a json file locally on my assets directory. Hence, I tried moving the demo json to a file but when I try to read it I am able to see that the reading of the json correctly only if u put the json content at the page.module.ts file.

  • Hosting type
    • Form.io
    • Local deployment
      • Version:
  • Formio.js version: 4.9.0
  • Frontend framework: Angular Material
  • Browser: Chrome
  • Browser version: ** 80.0.3987.163 **

Steps to Reproduce

  1. Create a json file at src/assets (https://examples.form.io/kitchensink)
  2. At the page ts file read it as below
    page.html
<mat-formio [form]="customForm" (submit)="onSubmit($event)"></mat-formio>

page.component.ts

import * as ubuntu from '../../../assets/file.json';

export class AboutPageComponent implements OnInit {
   customForm: any = ubuntu;
}

Expected behavior

Form should be generated.

Observed behavior

Nothing is generated.

@weihan1394 weihan1394 added the bug Something isn't working label Apr 10, 2020
@weihan1394 weihan1394 changed the title [BUG] [BUG] Form not generated if reading from json file Apr 10, 2020
@weihan1394
Copy link
Author

Sorry, I manage to fix it. It was my mistake at the importing of the json.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant