0

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?

1 Answer 1

1

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

export class Idea {
  id: number;
  date: Date;
  featured: boolean;
  content: string;
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, funnily enough I just tried that and it worked so I already got it working. Thanks for your answer!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.