Skip to content

Commit

Permalink
feat(module:select): support placeholder for basic select (#703)
Browse files Browse the repository at this point in the history
close #413
  • Loading branch information
vthinkxie authored Dec 8, 2017
1 parent 3d4213f commit a842cdd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/components/select/nz-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ import { NzOptionPipe } from './nz-option.pipe';
(keydown.ArrowUp)="handleKeyUpEvent($event)"
(keydown.ArrowDown)="handleKeyDownEvent($event)">
<div class="ant-select-selection__rendered" *ngIf="!nzShowSearch">
<div class="ant-select-selection__placeholder">
<ng-template [ngIf]="!_selectedOption">
{{ nzPlaceHolder }}
</ng-template>
</div>
<div class="ant-select-selection-selected-value">
{{ _selectedOption?.nzLabel }}
</div>
Expand Down Expand Up @@ -173,7 +178,7 @@ export class NzSelectComponent implements OnInit, AfterContentInit, AfterContent
_selectionPrefixCls = `${this._prefixCls}-selection`;
_size: string;
_value: string[] | string;
_placeholder = 'Placeholder';
_placeholder = 'placeholder';
_notFoundContent = this._locale.translate('Select.notFoundContent');
_searchText = '';
_triggerWidth = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/showcase/nz-demo-select/nz-demo-select-basic.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { Component, OnInit } from '@angular/core';
@Component({
selector: 'nz-demo-select-basic',
template: `
<nz-select style="width: 120px;" [(ngModel)]="selectedOption" nzAllowClear>
<nz-select style="width: 120px;" [(ngModel)]="selectedOption" [nzPlaceHolder]="'choose option'" nzAllowClear>
<nz-option
*ngFor="let option of options"
[nzLabel]="option.label"
[nzValue]="option"
[nzDisabled]="option.disabled">
</nz-option>
</nz-select>
<nz-select style="width: 120px;" [(ngModel)]="selectedOption" nzDisabled>
<nz-select style="width: 120px;" [(ngModel)]="selectedOption" [nzPlaceHolder]="'choose option'" nzDisabled>
<nz-option
*ngFor="let option of options"
[nzLabel]="option.label"
Expand Down

0 comments on commit a842cdd

Please sign in to comment.