dyaliCode / svelte-formly

Generator dynamic forms for Svelte JS
https://svelte.formly-js.com
MIT License
253 stars 30 forks source link

Instructions update #17

Closed kuhlaid closed 4 years ago

kuhlaid commented 4 years ago

I would suggest updating the instruction to use valid JSON for the 'const fields' value. Instead of using

const fields = [
    {
      type: "color",
      name: "color",
      id: "color",
      label: "Color Form"
    }...

use

const fields = [
    {
      "type": "color",
      "name": "color",
      "id": "color",
      "label": "Color Form"
    }...

This module is super helpful, so thank you for creating it. The reason I suggest the change to the instructions is I store the 'const fields' JSON values in indexedDb and dynamically load it into my Svelte app and simply use JSON.parse() to assign the value to the fields variable. If the fields value is not valid JSON this does not work.

kamalkech commented 4 years ago

The both work fine.

1- Test the both samples 2- I close this issue :)