0

I'm getting the following error when trying to compile my code on Angular 7.2.0 with TypeScript version 3.2.2:

error TS1005: ',' expected.**…

It is linked to the line where I try to declare a const object.

addAppareil(name: string status: string) {
    const appareilObject = {
      id: 0,
      name: '',
      status: ''
    };
  }

I don't get why it isn't correct, I've tried a lot of ways to do this but nothing worked good and nothing on the web that matches my problem.

1 Answer 1

2

You forget to put comma in arguments:

addAppareil(name: string, status: string) { // <---- In This Line

 }
Sign up to request clarification or add additional context in comments.

3 Comments

Me too in the beginning :) Not a usual place to expect such typo
LOL i feel idiot now U_u thank's to you for such good eyes haha
Don't feel that way. Glad to help :)

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.