Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

placeholder in angular 9 select

Set initial value of month = null in the component.ts and
add [(ngModel)]="month" in the select tag of component.html.

//component.ts
month = null;

//component.html
<form  #filter="ngForm" (ngSubmit)="filterta(filter)" style="display: flex;">
       <select name="month" [(ngModel)]="month" #month required>
                <option [ngValue]="null" [disabled]="true" >All</option>
                <option value="1">January</option>
       </select>
</form>
 
PREVIOUS NEXT
Tagged: #placeholder #angular #select
ADD COMMENT
Topic
Name
8+7 =