Skip to content

Commit 229c14d

Browse files
committed
docs: improve structure of docs app
1 parent 1bf5abf commit 229c14d

File tree

5 files changed

+70
-61
lines changed

5 files changed

+70
-61
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { provideHttpClient } from '@angular/common/http';
2+
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
3+
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
4+
import { provideAnimations } from '@angular/platform-browser/animations';
5+
import { provideRouter } from '@angular/router';
6+
import { MarkdownModule } from 'ngx-markdown';
7+
import { routes } from './app.routes';
8+
9+
export const appConfig: ApplicationConfig = {
10+
providers: [
11+
importProvidersFrom(MarkdownModule.forRoot()),
12+
{
13+
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
14+
useValue: {
15+
subscriptSizing: 'dynamic',
16+
},
17+
},
18+
provideAnimations(),
19+
provideHttpClient(),
20+
provideRouter(routes),
21+
],
22+
};

projects/angular-intl-demo/src/app/app.routes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export const routes: Routes = [
88
},
99
{
1010
path: 'pipes',
11-
loadComponent: () => import('./pipes/pipes.component'),
1211
loadChildren: () => import('./pipes/pipes.routes'),
1312
},
1413
{

projects/angular-intl-demo/src/app/pipes/pipes.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
99
standalone: true,
1010
imports: [MatTabsModule, RouterLink, RouterLinkActive, RouterOutlet],
1111
})
12-
export default class PipesComponent {}
12+
export class PipesComponent {}

projects/angular-intl-demo/src/app/pipes/pipes.routes.ts

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,57 @@ import { DecimalComponent } from './decimal/decimal.component';
66
import { LanguageComponent } from './language/language.component';
77
import { ListComponent } from './list/list.component';
88
import { PercentComponent } from './percent/percent.component';
9+
import { PipesComponent } from './pipes.component';
910
import { RelativeTimeComponent } from './relative-time/relative-time.component';
1011
import { UnitComponent } from './unit/unit.component';
1112

1213
const routes: Routes = [
13-
{
14-
path: 'date',
15-
component: DateComponent,
16-
},
17-
{
18-
path: 'decimal',
19-
component: DecimalComponent,
20-
},
21-
{
22-
path: 'percent',
23-
component: PercentComponent,
24-
},
25-
{
26-
path: 'currency',
27-
component: CurrencyComponent,
28-
},
29-
{
30-
path: 'unit',
31-
component: UnitComponent,
32-
},
33-
{
34-
path: 'language',
35-
component: LanguageComponent,
36-
},
37-
{
38-
path: 'country',
39-
component: CountryComponent,
40-
},
41-
{
42-
path: 'list',
43-
component: ListComponent,
44-
},
45-
{
46-
path: 'relative-time',
47-
component: RelativeTimeComponent,
48-
},
4914
{
5015
path: '',
51-
redirectTo: 'date',
52-
pathMatch: 'full',
16+
component: PipesComponent,
17+
children: [
18+
{
19+
path: 'date',
20+
component: DateComponent,
21+
},
22+
{
23+
path: 'decimal',
24+
component: DecimalComponent,
25+
},
26+
{
27+
path: 'percent',
28+
component: PercentComponent,
29+
},
30+
{
31+
path: 'currency',
32+
component: CurrencyComponent,
33+
},
34+
{
35+
path: 'unit',
36+
component: UnitComponent,
37+
},
38+
{
39+
path: 'language',
40+
component: LanguageComponent,
41+
},
42+
{
43+
path: 'country',
44+
component: CountryComponent,
45+
},
46+
{
47+
path: 'list',
48+
component: ListComponent,
49+
},
50+
{
51+
path: 'relative-time',
52+
component: RelativeTimeComponent,
53+
},
54+
{
55+
path: '',
56+
redirectTo: 'date',
57+
pathMatch: 'full',
58+
},
59+
],
5360
},
5461
];
5562

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
1-
import { provideHttpClient } from '@angular/common/http';
2-
import { importProvidersFrom } from '@angular/core';
3-
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
41
import { bootstrapApplication } from '@angular/platform-browser';
5-
import { provideAnimations } from '@angular/platform-browser/animations';
6-
import { provideRouter } from '@angular/router';
7-
import { MarkdownModule } from 'ngx-markdown';
82
import { AppComponent } from './app/app.component';
9-
import { routes } from './app/app.routes';
3+
import { appConfig } from './app/app.config';
104

11-
bootstrapApplication(AppComponent, {
12-
providers: [
13-
importProvidersFrom(MarkdownModule.forRoot()),
14-
{
15-
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
16-
useValue: {
17-
subscriptSizing: 'dynamic',
18-
},
19-
},
20-
provideAnimations(),
21-
provideHttpClient(),
22-
provideRouter(routes),
23-
],
24-
}).catch((err) => {
5+
bootstrapApplication(AppComponent, appConfig).catch((err) => {
256
console.error(err);
267
});

0 commit comments

Comments
 (0)