How can I convert a number to a string in a typescript file within Angular 7? I need to send two pieces of data, an ID and a name, to the backend. However, the backend only accepts the name. What steps should I take to correct this issue?
public saveCode(e): void {
let name = e.target.value;
let list = this.codeList.filter(x => x.name === name)[0];
//The line below is causing the error
this.restaurant.restaurantId = list.restaurantId;
//However, this line works without any issues
this.restaurant.name = list.name;
I am looking for a solution to change the restaurantId to a string.