Return value in Json with angle 2 [closed]

1

I'm working on a project where I need to return a database value that is fetched via REST in json format. The front-end of the project is angular 2.

I have a table of workers and need that when the user clicks the edit button, it already brings the values of the database in the labels.

I'm a beginner in angular 2.

    
asked by anonymous 25.07.2017 / 20:29

1 answer

0

Try using the Angular ReactiveForms along with FormGroup and its formControls.

Basically you normally configure the form in HTML and in the Typescript you define the values, validators and etc.

In the table when clicking you should call api through the Http of angular and associate the values of the API response to formgroup with setValue.

I created a plunker below with fixed data to make it clearer, I hope I have helped:

link

    
28.07.2017 / 15:37