ampersand icon indicating copy to clipboard operation
ampersand copied to clipboard

CLI-generated form doesn't keep the `type` attribute from the model

Open e2jk opened this issue 10 years ago • 0 comments

A model containing this props (extract):

        numberOfRecords: ['number', false, '']

generates the following form by calling $ ampersand gen form client/models/object.js (extract)

            new InputView({
                label: "Number Of Records",
                name: "numberOfRecords",
                value: this.model.numberOfRecords || "",
                required: false,
                placeholder: "Number Of Records",
                parent: this
            })

The dataType is defined as "number" in the model, the form needs a corresponding type: 'number'.

I suppose changes need to be done to lib/gen-types/form.js and lib/templates/input.js, please advise.

e2jk avatar Feb 18 '15 14:02 e2jk