Skip to content

Commit 77f9865

Browse files
committed
chore: use utility arrays
1 parent c90d723 commit 77f9865

File tree

19 files changed

+77
-111
lines changed

19 files changed

+77
-111
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { Component } from '@angular/core';
2+
import { RouterOutlet } from '@angular/router';
3+
import { HeaderComponent } from './components/header/header.component';
4+
import { FooterComponent } from './components/footer/footer.component';
5+
import { ActionButtonsComponent } from './components/action-buttons/action-buttons.component';
26

37
@Component({
48
selector: 'app-root',
9+
imports: [RouterOutlet, HeaderComponent, FooterComponent, ActionButtonsComponent],
510
template: `
611
<app-header></app-header>
712
@@ -11,7 +16,6 @@ import { Component } from '@angular/core';
1116
</main>
1217
1318
<app-footer></app-footer>
14-
`,
15-
standalone: false
19+
`
1620
})
1721
export class AppComponent {}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2+
import { provideRouter, withHashLocation } from '@angular/router';
3+
import { provideAnimations } from '@angular/platform-browser/animations';
4+
5+
import { routes } from './app.routes';
6+
import { StockDataService } from './services/stock-data.service';
7+
8+
export const appConfig: ApplicationConfig = {
9+
providers: [
10+
provideZoneChangeDetection(),
11+
provideRouter(routes, withHashLocation()),
12+
provideAnimations(),
13+
StockDataService
14+
]
15+
};

examples-standalone/finance-portfolio/src/app/app.module.ts

Lines changed: 0 additions & 72 deletions
This file was deleted.

examples-standalone/finance-portfolio/src/app/app-routing.module.ts renamed to examples-standalone/finance-portfolio/src/app/app.routes.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
import { NgModule } from '@angular/core';
2-
import { Routes, RouterModule } from '@angular/router';
1+
import { Routes } from '@angular/router';
32
import { StocksComponent } from './components/stocks/stocks.component';
43
import { HeatmapComponent } from './components/heatmap/heatmap.component';
54
import { UserProfileComponent } from './components/user-profile/user-profile.component';
65
import { RealTimeDataComponent } from './components/real-time-data/real-time-data.component';
76

8-
const routes: Routes = [
7+
export const routes: Routes = [
98
{ path: 'stocks', component: StocksComponent },
109
{ path: 'heatmap', component: HeatmapComponent },
1110
{ path: 'real-time', component: RealTimeDataComponent },
1211
{ path: 'profile', component: UserProfileComponent },
1312
{ path: '', redirectTo: '/stocks', pathMatch: 'full' },
1413
{ path: '**', redirectTo: '/stocks', pathMatch: 'full' }
1514
];
16-
17-
@NgModule({
18-
imports: [RouterModule.forRoot(routes, { useHash: true })],
19-
exports: [RouterModule]
20-
})
21-
export class AppRoutingModule {}

examples-standalone/finance-portfolio/src/app/components/action-buttons/action-buttons.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Component } from '@angular/core';
22
import { SVGIcon, downloadIcon, fileTxtIcon } from '@progress/kendo-svg-icons';
3+
import { KENDO_BUTTONS } from '@progress/kendo-angular-buttons';
34

45
@Component({
56
selector: 'app-action-buttons',
67
templateUrl: './action-buttons.component.html',
78
styleUrls: ['./action-buttons.component.scss'],
8-
standalone: false
9+
imports: [KENDO_BUTTONS]
910
})
1011
export class ActionButtonsComponent {
1112
public filteText: SVGIcon = fileTxtIcon;

examples-standalone/finance-portfolio/src/app/components/badge/badge.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { Component, Input, HostBinding } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
23

34
@Component({
45
selector: 'app-badge',
56
templateUrl: './badge.component.html',
67
styleUrls: ['./badge.component.scss'],
7-
standalone: false
8+
imports: [CommonModule]
89
})
910
export class BadgeComponent {
1011
@Input() public item: any;

examples-standalone/finance-portfolio/src/app/components/footer/footer.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { Router } from '@angular/router';
55
selector: 'app-footer',
66
templateUrl: './footer.component.html',
77
styleUrls: ['./footer.component.scss'],
8-
encapsulation: ViewEncapsulation.None,
9-
standalone: false
8+
encapsulation: ViewEncapsulation.None
109
})
1110
export class FooterComponent {
1211
public currentYear: number = new Date().getFullYear();

examples-standalone/finance-portfolio/src/app/components/header/header.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { Component, ViewEncapsulation } from '@angular/core';
22
import { Router } from '@angular/router';
33
import { StockDataService } from '../../services/stock-data.service';
4+
import { KENDO_DROPDOWNS } from '@progress/kendo-angular-dropdowns';
45

56
@Component({
67
selector: 'app-header',
78
templateUrl: './header.component.html',
89
styleUrls: ['./header.component.scss'],
910
encapsulation: ViewEncapsulation.None,
10-
standalone: false
11+
imports: [KENDO_DROPDOWNS]
1112
})
1213
export class HeaderComponent {
1314
public listItems: Array<string> = ['USD', 'EUR', 'GBP'];

examples-standalone/finance-portfolio/src/app/components/heatmap/heatmap.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Component, ElementRef, ViewChild, AfterViewInit, ViewEncapsulation, OnD
22
import { formatCurrency } from '../../pipes/helpers';
33
import { StockDataService } from '../../services/stock-data.service';
44
import { Stock } from '../../models';
5+
import { NavigationComponent } from '../navigation/navigation.component';
56

67
declare var kendo: any;
78

@@ -10,7 +11,7 @@ declare var kendo: any;
1011
templateUrl: './heatmap.component.html',
1112
styleUrls: ['./heatmap.component.scss'],
1213
encapsulation: ViewEncapsulation.None,
13-
standalone: false
14+
imports: [NavigationComponent]
1415
})
1516
export class HeatmapComponent implements AfterViewInit, OnDestroy {
1617
@ViewChild('heatmap') heatmap: ElementRef | undefined;

examples-standalone/finance-portfolio/src/app/components/navigation/navigation.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { Component, HostBinding } from '@angular/core';
2+
import { RouterLink, RouterLinkActive } from '@angular/router';
3+
import { KENDO_BUTTONS } from '@progress/kendo-angular-buttons';
24

35
@Component({
46
selector: 'app-navigation',
57
templateUrl: './navigation.component.html',
68
styleUrls: ['./navigation.component.scss'],
7-
standalone: false
9+
imports: [RouterLink, RouterLinkActive, KENDO_BUTTONS]
810
})
911
export class NavigationComponent {
1012
@HostBinding('class.text-center')

0 commit comments

Comments
 (0)