When I send a LocalDateTime field as Long type from Spring Boot, it is not deserialized in Angular and remains as long instead of being converted to Date.
Is there a universal deserialization setting for this in Angular? I am looking for a solution without having to manually convert the field using new Date(field_name).
JSON data sent from Spring Boot
..."field_1":1666256336000...
Angular model
export class Object1 {
field_1: Date;
}
Angular Service Method
method_name(){
return this.getHttp().get<Object1>(..urls..);
}
We call the method
this.service.method_name().pipe().subscribe((data: Object1) => {
console.log(data.field_1)
});
The output appears like this
1666256336000