I use Rails 5 + Angular2 to build a web application, and I have a model called Books. My problem is that I have a file called "books.ts" that has code:
export class Book {
id: number;
author_one: string;
author_two: string;
author_three: string;
title: string;
subtitle: string;
publisher: string;
year: date;
city: string;
edition: number;
volume: number;
pages: number;
ISBN: string;
barcode: string;
}
But when I ran "ng serve --port 9000", I got the following error:
Cannot find name 'date'.
Before I ran into the same problem with other attributes, because I used "integer", but I changed it to "number", and it worked, so I wonder if the attribute types are obscure about Angular. But after searching the Internet, I did not find how to declare a variable of type "date" in Angular. Is there a way to declare a date type variable? Or should I use a string and have some sort of treatment to use it as a date?