I have a form in my angular 2 Project.
I know how to Retrieve data from the API. But don't know how to Perform a CRUD operation in there.
Can anybody help me with the simple codes on How to Send form data in JSON format to a Web Service in PHP/Any other Language...
In Angular 2+ we handle forms two ways:
Here I am sharing code for simple template-driven forms. If you want to do it using reactive forms then check this link: Angular2 reactive form confirm equality of values
Your module file should have these:
Simple registration html file:
Now your registration.ts file should be like this:
To handle this data on server side use this link: How to post json object with Http.post (Angular 2) (php server side). I think this is more than sufficient.