Share via

Property 'value' does not exist on type '() => void'.ts(2339)

Asjad Butt 71 Reputation points
2022-11-08T05:53:42.733+00:00

hi rather simple angular form error still being quite tedious so this comes when i try to post a value to the data base by using angular forms
not much to explain ill just attach a ts file for understanding
258113-image.png

Developer technologies | ASP.NET Core | Other
0 comments No comments

Answer accepted by question author

Anonymous
2022-11-08T08:57:32.463+00:00

Hi @Asjad Butt ,

Please check your code, the initializeForm method/function is a void method/function, so it doesn't have the value property and the return data. So, in the AddTask method, just calling it as below:

AddTask(){  
     this.initializeForm();  
}  

If you want to return data in the method, in the method, you need to use the return statement, like this:

258110-image.png
Then, calling the getItems method to get the data.

 items = this.cartService.getItems();  

Refer to this tutorial: Managing data.


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Best regards,
Dillion

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.