Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbavykin1991 authored Oct 11, 2021
1 parent 0593f21 commit b2a6f27
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,44 @@ export default class ExampleComponent extends Component {
}
```

```hbs
<div class="">
<form class="form-example" {{on "submit" (fn this.submit)}}>
<h1>Form Example...</h1>
<label for="">
<input
type="text"
name=""
value={{this.firstName}}
{{on "input" (pick "target.value" (fn (mut this.firstName)))}}
{{on "input" (fn this.validate "firstName")}}
{{on "blur" (fn this.validate "firstName")}}
>
{{#if this.errors.firstName}}
<span class="error">{{this.errors.firstName}}</span>
{{/if}}
</label>
<label for="">
<input
type="text"
name=""
value={{this.lastName}}
{{on "input" (pick "target.value" (fn (mut this.lastName)))}}
{{on "input" (fn this.validate "lastName")}}
{{on "blur" (fn this.validate "lastName")}}
>
{{#if this.errors.lastName}}
<span class="error">{{this.errors.lastName}}</span>
{{/if}}
</label>
<button type="submit" name="button">Save</button>
</form>
</div>
```


Contributing
------------------------------------------------------------------------------
Expand Down

0 comments on commit b2a6f27

Please sign in to comment.