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:
@@ -1,13 +1,24 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {ScrollService} from '../scroll/scroll.service';
|
||||
import {TeamService} from '../../api';
|
||||
import {CommonModule, NgOptimizedImage} from '@angular/common';
|
||||
import {HeaderComponent} from '../header/header.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-team',
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
HeaderComponent,
|
||||
NgOptimizedImage
|
||||
],
|
||||
templateUrl: './team.component.html',
|
||||
styleUrl: './team.component.scss'
|
||||
})
|
||||
export class TeamComponent {
|
||||
constructor(public scrollService: ScrollService) {
|
||||
constructor(public scrollService: ScrollService, public teamApi: TeamService) {
|
||||
teamApi.getTeamMembers("test").subscribe(res => {
|
||||
console.log(res)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user