typescript - Angular 2 : form, when book option, start and end date are not needed -


html:

<md-select placeholder="type" required [(ngmodel)]="request.type" (ngmodelchange)="valuedateneeded()"> <md-option *ngfor="let type of requesttypes" [value]="type.value">  {{type.name}}  </md-option>  </md-select> 

i want value of option chosen. link valuedateneeded() can set true or false depending on value , can show or not show div.

you need use [(ngmodel)]

example

component.ts

public variablestore: any; 

component.html

<select [(ngmodel)]="variablestore">   <option value="1">1</option> </select 

the value inside variablestore


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -