fix(input): add date and time inputs

Closes #744
This commit is contained in:
Adam Bradley
2015-12-14 20:40:53 -06:00
parent 0d15c3cbef
commit 2a32711857
2 changed files with 12 additions and 2 deletions

View File

@ -76,6 +76,16 @@
<textarea>KA-CHOW!</textarea>
</ion-input>
<ion-input>
<ion-label>Beginning:</ion-label>
<input value="2005-07-30" type="date">
</ion-input>
<ion-input>
<ion-label>Time:</ion-label>
<input value="12:00pm" type="time">
</ion-input>
</ion-list>
<ion-input>

View File

@ -106,7 +106,7 @@ export class TextInput {
* This function is used to add the Angular css classes associated with inputs in forms
*/
addNgClass(className) {
return this.input.elementRef.nativeElement.classList.contains(className);
this.input && this.input.elementRef.nativeElement.classList.contains(className);
}
/**
@ -456,7 +456,7 @@ export class TextInput {
* @private
*/
@Directive({
selector: 'textarea,input[type=text],input[type=password],input[type=number],input[type=search],input[type=email],input[type=url],input[type=tel]',
selector: 'textarea,input[type=text],input[type=password],input[type=number],input[type=search],input[type=email],input[type=url],input[type=tel],input[type=date],input[type=datetime],input[type=datetime-local],input[type=week],input[type=time]',
inputs: ['value'],
host: {
'(focus)': 'focusChange(true)',