I am facing an issue where the (change) event is not triggered when updating an input field that is being updated from a query.
Here is the HTML code for the input:
<input type="text" [ngModel]="inputValue" id="itemText" (ngModelChange)="setNewItem($event)">
This is the function in the component file related to the input:
setNewItem(item){
console.log("Triggered");
return this.ds.setItem(item);
}
The input field is being updated in the index HTML using the following script:
<script>
....
onSelect: function (request, response) {
var urlApi = 'http://localhost:8088/Badges/Details/' + request.item;
$.ajax({
type: "GET",
url: urlApi,
dataType: 'json',
success: function(response) {
document.getElementById("itemText").value = response.items[0].item; }
});
}
</script>