2016-08-05 5 views
1

@angular2-materail 구성 요소를 사용하여 응용 프로그램을 빌드하고 양식 입력 요소의 형식을 지정합니다. md-input, md-checkbox 등을 사용하고 있지만 선택 드롭 다운을 표시하는 구성 요소를 찾지 못했습니다. select 드롭 다운을 포맷하는 데 사용할 수있는 구성 요소가 있습니까?angular2-app에 대한 angular2-material 디자인에서 select 태그 드롭 다운을 사용해야하는 방법

답변

0

내가 아는 한, 개발 중에 md-select이 있으며, 아직 사용할 수 없습니다. 그러나이 문제의 현재 진행 상황을 추적 할 수 있습니다 : angular2-material issue 118. 여기

0

//Your component 
 

 
import {Component} from '@angular/core'; 
 

 

 
@Component({ 
 
    selector: 'select-form-example', 
 
    templateUrl: 'select-form-example.html', 
 
}) 
 
export class SelectFormExample { 
 
    selectedValue: string; 
 

 
    foods = [ 
 
    {value: 'steak-0', viewValue: 'Steak'}, 
 
    {value: 'pizza-1', viewValue: 'Pizza'}, 
 
    {value: 'tacos-2', viewValue: 'Tacos'} 
 
    ]; 
 
}
<form> 
 
    <md-select placeholder="Favorite food" [(ngModel)]="selectedValue" name="food"> 
 
    <md-option *ngFor="let food of foods" [value]="food.value"> 
 
     {{food.viewValue}} 
 
    </md-option> 
 
    </md-select> 
 

 
    <p> Selected value: {{selectedValue}} </p> 
 
</form>

이다