Skip to content

Commit

Permalink
docs: glimmer syntax in form demo
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabauke committed Jan 5, 2022
1 parent e0a98e1 commit 363059a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/dummy/app/templates/docs/components/validated-form.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ the `loading` template parameter:
<!-- prettier-ignore-start -->
{{#docs-demo as |demo|}}
{{#demo.example name='validated-form-action-template.hbs'}}
{{#validated-form model=(changeset model) on-submit=(action 'submit') as |f|}}
{{f.submit label=(if f.loading 'Saving...' 'Save') disabled=f.loading}}
{{/validated-form}}
<ValidatedForm @model={{(changeset model)}} @on-submit={{this.submit}} as |f|>
{{#let f.submit as |Submit|}}
<Submit @label={{if f.loading 'Saving...' 'Save'}} @disabled={{f.loading}}/>
{{/let}}
</ValidatedForm>
{{/demo.example}}

{{demo.snippet 'validated-form-action-template.hbs'}}
Expand All @@ -47,9 +49,11 @@ It also works very well with [ember-concurrency](http://ember-concurrency.com/)
<!-- prettier-ignore-start -->
{{#docs-demo as |demo|}}
{{#demo.example name='validated-form-task-template.hbs'}}
{{#validated-form model=(changeset model) on-submit=(perform submit) as |f|}}
{{f.submit label=(if f.loading 'Saving...' 'Save') disabled=f.loading}}
{{/validated-form}}
<ValidatedForm @model={{(changeset model)}} @on-submit={{perform this.submit}} as |f|>
{{#let f.submit as |Submit|}}
<Submit @label={{if f.loading 'Saving...' 'Save'}} @disabled={{f.loading}}/>
{{/let}}
</ValidatedForm>
{{/demo.example}}

{{demo.snippet 'validated-form-task-template.hbs'}}
Expand Down

0 comments on commit 363059a

Please sign in to comment.