I can definitely help you with that! Here's the translation:
我正在创建一个新闻应用程序,参考此链接https://www.youtube.com/watch?v=D8J9QUwTWmU&t=3s&ab_channel=CodeXpression。在首次在服务器上检查时出现了错误:
未捕获的错误:类型HttpClient没有'ɵmod'属性
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';
import{HttpClient, HttpClientModule}from '@angular/common/http';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,HttpClientModule,HttpClient],
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
bootstrap: [AppComponent],
})
export class AppModule {}
app.component.ts
import { Component } from '@angular/core';
import { HttpClient,HttpClientModule } from '@angular/common/http';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
})
export class AppComponent {
constructor(private http:HttpClient) {}
}