Cannot read Property 'id' of Undefined

Asked

Viewed 4,038 times

0

I am getting an error when entering the bug-Details route, before even clicking the routerlink to try to access Edit-bug, which is my intention. The mistake is:

ERROR Typeerror: Cannot read Property 'id' of Undefined At object.Eval [as updateDirectives] (Bugdetailcomponent.html:14)

Can you give me a hand? The code is on https://stackblitz.com/edit/angular-sm7joh

  • Could you give more details? What object are you trying to use id?

1 answer

1


Statement

bug: any;

Correction

const bug = bugDetails[i];
//para
this.bug = bugDetails[i];

as you stated as a constant the template cannot reference

  • Thank you Willian!

  • why down vote?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.