I want to build a comment section in my Angular App. These comments are supposed to be stored in a database, so I want to forward the data from Angular to Node.js, where it can be passed on to the database. So I created an input field for comments in detail.component.html. The comment is saved when the user hits enter.
<input #box (keyup.enter)="update(box.value)">
<p>{{value}}</p>
In detail.component.ts I save the comment in a variable:
public value: any= []
update(comment: any) { this.value = comment; }
//code
this.dataService.addComment().subscribe(comment => this.value = comment)
Here is the first problem - how do I get the comment to data.service.ts?
//code
addComment() {}
And then there is the actual question: How can I forward this comment to server.js in the node.js App?
I am quite new to Angular, so I am pretty clueless of how to achive this. I found this question How to pass form data from angular to nodejs samewhat useful, but could not apply it to my usecase. So how can I transfer the data from Angular to Node.js?