I have a class Person with a date field in it:
export class Persoon {
name: string;
dateOfBirth: Date;
}
My Java server gives a json string like:
{"person":{"name":"Jansen","dateOfBirth":"1959-04-16"}}
In the debugger I get the impression that AngularJS2 thinks it's a string, when I use a datepipe the following error occurs:
EXCEPTION: Invalid argument '1959-04-16' for pipe 'DatePipe' in [{{person.dateOfBirth | date:"dd-MM-yy"}} in PersonenComponent@26:10]
How can I make a Date of dateOfBirth?