Answers for "anguylar select placeholder"

2

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>
Posted by: Guest on January-07-2021
-1

angularjs select placeholder

//angular 1.2.16
<select id="year"  ng-model="insData.S_FinYear" name="f_year">
                        <option value="" disabled selected>Fin Year</option>
                        <option ng-repeat="YR in F_Year_List" value="{{YR.f_id}}">
                                {{YR.f_year}}
                        </option>
</select><i></i>
 //nb: not work with ng-options.
Posted by: Guest on December-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language