小编Akc*_*cil的帖子

@ angular / common / http没有导出的成员'RequestOptions'

我想使用Firebase函数使用角度为6的电子邮件打磨电子邮件,但是角度引发此错误:

错误TS2305:模块'“ E:/ project / node_modules / @ angular / common / http”'没有导出的成员'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 …
Run Code Online (Sandbox Code Playgroud)

angular angular-httpclient

2
推荐指数
1
解决办法
4532
查看次数

标签 统计

angular ×1

angular-httpclient ×1