Get value of a select with angular and reactive forms?

0

I have this select but I am not able to get the selected value:

<div class="form-group">
                                <div class="col-sm-7 col-xs-12">
                                    <label>Modelo</label>                                       
                                    <select formControlName="model_vehicle" name="model_vehicle" (change)="cambiaDatos()" class="selectpicker form-control bs-select-hidden" data-live-search="true" dropdown>
                                            <option *ngFor="let menu of this._menu.menuesModel" value="1">{{menu.model}}</option>                               
                                    </select>
                                </div>
                            </div>

the function that must be invoked is:

cambiaDatos() {
let v = $('.selectpicker').val();
console.log(v);

I clarify that if I remove the classes that the select has if it works, but I want to be able to use them too. Any suggestions?

    
asked by valentin rodriguez 30.05.2018 в 21:13
source

0 answers