I want to sand emails with angular 6 using an firebase function, but angular throws this error:
error TS2305: Module '"E:/project/node_modules/@angular/common/http"' has no exported member 'RequestOptions'.
import { Injectable } from '@angular/core';
import { NgForm } from '@angular/forms';
import { HttpClient, HttpHeaders, RequestOptions } from '@angular/common/http';
import 'rxjs';
@Injectable()
export class MailerService {
constructor(private httpClient: HttpClient) { }
send(form: NgForm) {
let url = 'TheUrlOfMyFunction';
let params: URLSearchParams = new URLSearchParams();
let options = {headers: new HttpHeaders({'Content-Type': 'application/json'})};
params.set('to', form.value['emailTo']);
params.set('from', form.value['emailFrom']);
params.set('subject', form.value['object']);
params.set('content', form.value['text']);
return this.httpClient.post(url, params, options)
.toPromise()
.then( res => { console.log(res) })
.catch(err => { console.log(err) })
}
}