In my Backend I have IDs as long. Sadly Angular or better Javascript does not like long ids very much and rounds large numbers. Since that is not optimal for IDs I need to convert it from long to string before parsing it into a json object:
this.http.get<Player>(this.getUrl() + '/' + id);
My Player class:
export class Player {
id: string;
name: string;
}
How can I covert the ids to string before making a object from them?
This is the backend answer:
{ "id": 12345, "name": "Test" }
This is what I need to convert it to before converting to an object:
{ "id": "12345", "name": "Test" }
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…