|
14 | 14 | <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> |
15 | 15 | <title>paper-input-date-picker Demo</title> |
16 | 16 | <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
| 17 | + <link rel="import" href="../../paper-button/paper-button.html"> |
17 | 18 | <link rel="import" href="../paper-input-date-picker.html"> |
18 | 19 | </head> |
19 | | - <body unresolved> |
| 20 | +<body unresolved> |
20 | 21 |
|
21 | | - <p>An example of <code><paper-input-date-picker></code>:</p> |
| 22 | + <template is="dom-bind" id="app"> |
22 | 23 |
|
23 | | - <p>An baic example of <code><paper-input-date-picker></code>:</p> |
24 | | - <paper-input-date-picker label="Pick a date..."></paper-input-date-picker> |
25 | | - <paper-input-date-picker label="Pick a date (No prefix icon)..." no-prefix-icon="true" style="width: 300px;"></paper-input-date-picker> |
26 | | - |
27 | | - |
28 | | - <p>An example of <code><paper-input-date-picker></code> with validaton messages:</p> |
29 | | - <paper-input-date-picker label="Pick a date..." required auto-validate error-message="needs some date!"></paper-input-date-picker> |
30 | | - |
31 | | - <script> |
32 | | - </script> |
| 24 | + <p>An example of <code><paper-input-date-picker></code>:</p> |
| 25 | + |
| 26 | + <p>An baic example of <code><paper-input-date-picker></code>:</p> |
| 27 | + <paper-input-date-picker label="Pick a date..."></paper-input-date-picker> |
| 28 | + <paper-input-date-picker label="Pick a date (No prefix icon)..." no-prefix-icon="true" style="width: 300px;"></paper-input-date-picker> |
| 29 | + |
| 30 | + |
| 31 | + <p>An example of <code><paper-input-date-picker></code> with validaton messages:</p> |
| 32 | + <paper-input-date-picker label="Pick a date..." required auto-validate error-message="needs some date!"></paper-input-date-picker> |
| 33 | + |
| 34 | + <p>An example of <code><paper-input-date-picker></code> with validaton messages:</p> |
| 35 | + <paper-input-date-picker id="dynInputDate" label="Pick a date..."></paper-input-date-picker> |
| 36 | + |
| 37 | + <paper-button label="Teste" on-tap="onClickDynValidation" auto-validate>Validate</paper-button> |
| 38 | + |
| 39 | + <script> |
| 40 | + |
| 41 | + window.addEventListener('WebComponentsReady', function() { |
| 42 | + |
| 43 | + var app = document.querySelector('#app'); |
| 44 | + |
| 45 | + app.onClickDynValidation = function () { |
| 46 | + |
| 47 | + this.$.dynInputDate.errorMessage = 'Errooooooo'; |
| 48 | + this.$.dynInputDate.setAttribute('invalid', 'true'); |
| 49 | + |
| 50 | + console.log('ssdsas', this.$.dynInputDate.value); |
| 51 | + }; |
| 52 | + }); |
| 53 | + </script> |
| 54 | + </template> |
33 | 55 | </body> |
34 | 56 | </html> |
0 commit comments