app.module.ts 743 B

12345678910111213141516171819202122232425
  1. import { NgModule } from '@angular/core';
  2. import { BrowserModule } from '@angular/platform-browser';
  3. import { RouteReuseStrategy, RouterModule } from '@angular/router';
  4. import { IonicModule } from '@ionic/angular';
  5. import { AppRoutingModule } from './app-routing.module';
  6. import { AppComponent } from './app.component';
  7. import { IonicRouteStrategy } from '@ionic/angular';
  8. @NgModule({
  9. declarations: [AppComponent],
  10. imports: [
  11. BrowserModule,
  12. IonicModule.forRoot(),
  13. RouterModule, // 确保导入 RouterModuler
  14. AppRoutingModule,
  15. ],
  16. providers: [
  17. {
  18. provide: RouteReuseStrategy,
  19. useClass: IonicRouteStrategy
  20. },
  21. // ...其他服务提供者
  22. ],
  23. bootstrap: [AppComponent],
  24. })
  25. export class AppModule {}