I am using bootstrap selectpicker in my angular 4 application and I have to default value to it from my type script code. These are the jquery methods given in this documentation https://silviomoreto.github.io/bootstrap-select/methods/
I want to call the methods only using angular. I have tried using ElementRef, here is my code,
this.elementref.nativeElement.selectpicker('val',[defaultvalues])
It gives me the error "selectpicker is not a function". But logging this.elementref.nativeElement prints the "select" element as shown below.
<select _ngcontent-c4="" appselectpicker="" class="selectpicker ng-untouched
ng-pristine ng-valid" data-live-search="true" formcontrolname="category"
multiple="" title="Any" tabindex="-98" ng-reflect-name="category">
<option _ngcontent-c4="" data-tokens="Food">Food </option>
<option _ngcontent-c4="" data-tokens="Coffee">Coffee</option>
<option _ngcontent-c4="" data-tokens="Night Life">Night
Life</option>
<option _ngcontent-c4="" data-tokens="Breakfast">Breakfast</option>
</select>