angular 2 error httpcliendmodule

前端 未结 1 1447
南笙
南笙 2021-01-25 10:51

have some error with httpclientmodule: i have app.module.ts and there is code :

import { NgModule }      from \'@angular/core\';
import { BrowserModule } from \         


        
1条回答
  •  伪装坚强ぢ
    2021-01-25 11:09

    It should be imported from @angular/common/http

    import {HttpClientModule} from '@angular/common/http';
    

    Make sure you have installed angular@^4.3.0 (changelog)

    See also the docs

    • https://angular.io/guide/http#setup-installing-the-module

    Plunker Example

    0 讨论(0)
提交回复
热议问题