Ryan Mc
Ryan Mc

Reputation: 925

AngularJS 2 Can't Start Node Server Errors

I'm building a sample app in Angular 2 and it was working fine before but now when I try to run it I get the following error in the terminal:

app/idea.ts(3,8): error TS2304: Cannot find name 'date'.

ideas.ts looks like this:

export class Idea {
  id: number;
  date: date;
  featured: boolean;
  content: string;
}

I've been having similar problems with other sample apps I've built. Does anybody know what might be causing this?

Upvotes: 0

Views: 44

Answers (1)

LDJ
LDJ

Reputation: 7304

Date is a Typescript interface in this case and should be uppercase:

export class Idea {
  id: number;
  date: Date;
  featured: boolean;
  content: string;
}

Upvotes: 1

Related Questions