-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(md-select): show-errortext option
md-select="show-errortext: false; label: ... default true
- Loading branch information
Showing
4 changed files
with
77 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,42 @@ | ||
<template> | ||
<select md-select="label: Don't select anything and click validate;" value.two-way="selectedValue & validate:rules"> | ||
<option value="" disabled selected>select an item</option> | ||
<option value="item1">item 1</option> | ||
<option value="item2">item 2</option> | ||
<option value="item3">item 3</option> | ||
<option value="item4">item 4</option> | ||
</select> | ||
<div style="margin-top: 15px;"> | ||
<button md-waves md-button click.delegate="validateModel()">validate</button> | ||
<button md-waves md-button click.delegate="reset()">reset</button> | ||
</div> | ||
<md-card md-title="Basic"> | ||
<select md-select="label: Don't select anything and click validate" value.two-way="selectedValue & validate:rules"> | ||
<option value="" disabled selected>select an item</option> | ||
<option value="item1">item 1</option> | ||
<option value="item2">item 2</option> | ||
<option value="item3">item 3</option> | ||
<option value="item4">item 4</option> | ||
</select> | ||
<div style="margin-top: 15px;"> | ||
<button md-waves md-button click.delegate="validateModel()">validate</button> | ||
<button md-waves md-button click.delegate="reset()">reset</button> | ||
</div> | ||
</md-card> | ||
|
||
<md-card md-title="Show or hide error text"> | ||
<select md-select="show-errortext.bind: showErrortext; label: Don't select anything and click validate" value.two-way="selectedValue2 & validate:rules"> | ||
<option value="" disabled selected>select an item</option> | ||
<option value="item1">item 1</option> | ||
<option value="item2">item 2</option> | ||
<option value="item3">item 3</option> | ||
<option value="item4">item 4</option> | ||
</select> | ||
<div style="margin-top: 15px;"> | ||
<button md-waves md-button click.delegate="validateModel2()">validate</button> | ||
<button md-waves md-button click.delegate="reset2()">reset</button> | ||
</div> | ||
<md-switch style="margin-top: 15px;" md-label-on="show" md-label-off="hide" md-checked.bind="showErrortext"></md-switch> | ||
</md-card> | ||
|
||
<md-card if.bind="controller.errors.length"> | ||
<h5 class="error-text">You have errors!</h5> | ||
<ul style="margin-top: 15px;"> | ||
<li repeat.for="error of controller.errors"> | ||
<a href="#" click.delegate="error.target.focus()"> | ||
${error.message} | ||
</a> | ||
</li> | ||
</ul> | ||
</md-card> | ||
|
||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters