feat(datetime): add placeholder attribute

fixes #7966
This commit is contained in:
Olivier Goguel
2017-02-13 14:59:22 -05:00
committed by Brandy Carney
parent 6a0c92c509
commit 52a6d41c86
5 changed files with 36 additions and 1 deletions

View File

@ -251,7 +251,8 @@ export const DATETIME_VALUE_ACCESSOR: any = {
@Component({
selector: 'ion-datetime',
template:
'<div class="datetime-text">{{_text}}</div>' +
'<div *ngIf="!_text" class="datetime-text datetime-placeholder">{{placeholder}}</div>' +
'<div *ngIf="_text" class="datetime-text">{{_text}}</div>' +
'<button aria-haspopup="true" ' +
'type="button" ' +
'[id]="id" ' +
@ -407,6 +408,12 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
*/
@Input() pickerOptions: any = {};
/**
* @input {string} The text to display when there's no date selected yet.
* Using lowercase to match the input attribute
*/
@Input() placeholder: string = '';
/**
* @input {string} The mode determines which platform styles to use.
* Possible values are: `"ios"`, `"md"`, or `"wp"`.