alphagov / govuk-prototype-kit-docs

Site for the GOV.UK Prototype Kit
https://prototype-kit.service.gov.uk/docs
MIT License
3 stars 2 forks source link

People often get the syntax for using data in a component wrong #30

Closed joelanman closed 1 year ago

joelanman commented 2 years ago

on support, people often try something like this:

{{ govukInput({
  label: {
    text: "Age in years"
  },
  id: "age",
  name: "age",
  value: "{{data['age']}}"
}) }}

when the correct syntax is

{{ govukInput({
  label: {
    text: "Age in years"
  },
  id: "age",
  name: "age",
  value: data['age']
}) }}

we do cover this in the tutorial but maybe it would help to have a guide page too

joelanman commented 1 year ago

covered here: https://prototype-kit.service.gov.uk/docs/pass-data