You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extract of the form generated by $ ampersand gen form client/models/object.js:
module.exports = FormView.extend({
fields: function () {
return [
new InputView({
label: "Abbreviation",
name: "abbreviation",
value: this.model.abbreviation || "",
required: false,
placeholder: "Abbreviation",
parent: this
}),
new InputView({
label: "Description",
name: "description",
value: this.model.description || "",
required: false,
placeholder: "Description",
parent: this
}),
Both InputView have required: false, while the first one should have been required: true.
The input template is located at lib/templates/input.js and contains the following:
required: {{{ required }}},
Meaning that the value "false" is not hardcoded. Investigating further, the value of the required variable seems to be determined in lib/gen-types/form.js:
required: !!definition.required,
That's about as far as I get with my current understanding of Ampersand.js. Does anyone have an idea what's going wrong in this case?
The text was updated successfully, but these errors were encountered:
e2jk
changed the title
CLI-generated form doens't respect required property
CLI-generated form doesn't respect required property of the model
Feb 18, 2015
Extract of a model called "object":
Extract of the form generated by
$ ampersand gen form client/models/object.js
:Both
InputView
haverequired: false
, while the first one should have beenrequired: true
.The input template is located at
lib/templates/input.js
and contains the following:Meaning that the value "false" is not hardcoded. Investigating further, the value of the
required
variable seems to be determined in lib/gen-types/form.js:That's about as far as I get with my current understanding of Ampersand.js. Does anyone have an idea what's going wrong in this case?
The text was updated successfully, but these errors were encountered: