以下の内容はhttps://www.aruse.net/entry/2018/10/29/094721より取得しました。


Fix:ERROR Error: StaticInjectorError(AppModule)[OAuthService -> HttpClient]: StaticInjectorError(Platform: core)[OAuthService -> HttpClient]: NullInjectorError: No provider for HttpClient!

Angular で OAuth の処理を行っている際に、以下のエラーが表示されました。

ERROR Error: StaticInjectorError(AppModule)[OAuthService -> HttpClient]: StaticInjectorError(Platform: core)[OAuthService -> HttpClient]: NullInjectorError: No provider for HttpClient!

これ、実際にはエラーに出力されている通りなのですが、HttpClientModule がインポートされていないことが原因です。

解決法は、app.module.ts に以下のインポート設定を追加します。

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

@NgModule({
  imports: [ HttpClientModule ]
})



以上の内容はhttps://www.aruse.net/entry/2018/10/29/094721より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14