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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

android - IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling -