Skip to content
Advertisement

Angular Property ‘expenseEntry’ does not exist on type ‘ExpenseEntryComponent’

  1. I am trying to build expense entry app from this tutorial https://www.tutorialspoint.com/angular8/angular8_pdf_version.htm page 33.

I am getting this error – Property ‘expenseEntry’ does not exist on type ‘ExpenseEntryComponent’. i have tried this links

a) Angular error TS2339 Property does not exist on type

b) Angular – How to fix ‘property does not exist on type’ error?

but i didnt get it clearly

  1. my expense-entry.ts file

JavaScript
  1. expense-entry.component.ts file is here

JavaScript
  1. my expense-entry.component.html file

JavaScript
  1. when i insert {{expenseentry.item}} it shows error. i tried restarting the server but didnt work

Advertisement

Answer

expense-entry.ts will only export interface. You have created two components with same name.

expense-entry.ts :

JavaScript

Then in your ExpenseEntryComponent.ts you need to import above interface as below:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement