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

Asjad Butt 71 Reputation points

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

A set of technologies in the .NET Framework for building web applications and XML web services.
4,308 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zhi Lv - MSFT 32,056 Reputation points Microsoft Vendor

    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:


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

    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,

0 additional answers

Sort by: Most helpful