Using the Bootstrap-select dropdown in Angular 2 forms with jQuery, I am attempting to call a Typescript method called onDropDownChangeChange on the onchange event. However, it seems to not be functioning as expected.
import { Component, OnInit, ViewChild } from '@angular/core';
import { RequestOptions } from '@angular/http';
import 'rxjs/add/observable/throw';
declare var $: JQueryStatic;
export class TestComponent implements OnInit {
selectedValue: string;
ngOnInit(): void {
$(function() {
var self = this;
$('.selectpicker').on('change', function(){
var selectedds = $(this).find('option:selected').val();
self.onDropDownChangeChange(selectedds); //This is not working
//this.onChange();
});
});
}
onDropDownChangeChange(value: string) {
this.selectedValue = value;
this.PopulateGrid(selectedValue);
}
}