Convert components to standalone and implement route-based loading
Refactored Angular components to standalone modules, enhancing modularity and reducing dependency on `AppModule`. Updated routes to facilitate lazy loading for improved performance and maintainability. Replaced `platformBrowserDynamic` with `bootstrapApplication` for modern bootstrapping.
This commit is contained in:
+13
-5
@@ -1,6 +1,14 @@
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
import {AppModule} from './app/app.module';
|
||||
import {bootstrapApplication} from '@angular/platform-browser';
|
||||
import {AppComponent} from './app/app.component';
|
||||
import {provideRouter} from '@angular/router';
|
||||
import {routes} from './app/app.routes';
|
||||
import {provideHttpClient} from '@angular/common/http';
|
||||
|
||||
|
||||
bootstrapApplication(AppComponent, {
|
||||
providers: [
|
||||
provideRouter(routes),
|
||||
provideHttpClient()
|
||||
]
|
||||
}).catch(err => console.error(err));
|
||||
|
||||
platformBrowserDynamic()
|
||||
.bootstrapModule(AppModule)
|
||||
.catch((err) => console.error(err));
|
||||
|
||||
Reference in New Issue
Block a user