I am trying to build a drop down with a few values.
However, on selecting a value, I want to make an API call that takes an id.
In my component.ts, I have an
Template/HTML File (component.ts)
Typescript File (component.ts)
values = [
{ id: 3432, name: "Recent" },
{ id: 3442, name: "Most Popular" },
{ id: 3352, name: "Rating" }
];
onChange(cityEvent){
console.log(cityEvent); // It will display the select city data
}
(ngModelChange) is the @Output of the ngModel directive. It fires when the model changes. You cannot use this event without the ngModel directive