I learning angular 2, and I don\'t see any example on the web to send a simple contact form from angular 2 to php scrip.
My html template.
For anyone that's interested in doing this in later versions of Angular, you'll notice that @angular/http
is deprecated and cannot be used without an error.
You should do all the above from HPierce but you use HttpClient
instead:
import {HttpClient} from "@angular/common/http";
Then convert all your types to HttpClient
instead, e.g.:
http : HttpClient;
constructor( http: HttpClient) {
this.http = http;
}
And you'll also need to import HttpClientModule
into your app.module.ts
!