have some error with httpclientmodule:
i have app.module.ts and there is code :
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import {HttpClientModule } from '@angular/http';
@NgModule({
imports: [ BrowserModule, FormsModule, HttpClientModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
和错误:
nodemodules/@angular/http/http 没有导出成员“HttpClientModule”
它应该是从进口的@angular/common/http
import {HttpClientModule} from '@angular/common/http';
确保您已经安装角度@^4.3.0 (变更日志)
另请参阅文档
- https://angular.io/guide/http#setup-installing-the-module
笨蛋的例子
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)