Skip to content

Commit 67c6485

Browse files
committed
docs: Add new feature for read random article in documentazione
Add random route: 'angular.dev/random' for read random article Fixed angular#68038
1 parent 4a174b8 commit 67c6485

6 files changed

Lines changed: 40 additions & 3 deletions

File tree

adev/src/app/core/constants/pages.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const DEFAULT_PAGES = {
1414
TUTORIALS: 'tutorials',
1515
PLAYGROUND: 'playground',
1616
UPDATE: 'update-guide',
17+
RANDOM: 'random',
1718
} as const;
1819

1920
export const PAGE_PREFIX = {
@@ -25,4 +26,5 @@ export const PAGE_PREFIX = {
2526
REFERENCE: 'reference',
2627
TUTORIALS: 'tutorials',
2728
UPDATE: 'update-guide',
29+
RANDOM: 'random',
2830
} as const;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>random works!</p>

adev/src/app/features/random/random.scss

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {ComponentFixture, TestBed} from '@angular/core/testing';
2+
3+
import {Random} from './random';
4+
5+
describe('Random', () => {
6+
let component: Random;
7+
let fixture: ComponentFixture<Random>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [Random],
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(Random);
15+
component = fixture.componentInstance;
16+
await fixture.whenStable();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {Component} from '@angular/core';
2+
3+
@Component({
4+
selector: 'adev-random',
5+
imports: [],
6+
templateUrl: './random.html',
7+
styleUrl: './random.scss',
8+
})
9+
export default class Random {}

adev/src/app/routing/routes.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ const cliReferencePageRoutes = mapNavigationItemsToRoutes(
5555
referenceNavigationItems.filter((r) => r.path?.startsWith(`${PAGE_PREFIX.CLI}/`)),
5656
{
5757
loadComponent: () =>
58-
import(
59-
'../features/references/cli-reference-details-page/cli-reference-details-page.component'
60-
),
58+
import('../features/references/cli-reference-details-page/cli-reference-details-page.component'),
6159
data: commonReferenceRouteData,
6260
},
6361
).map((route) => ({
@@ -148,6 +146,11 @@ export const routes: Route[] = [
148146
loadComponent: () => import('../features/playground/playground.component'),
149147
data: {...commonTutorialRouteData, label: 'Playground'},
150148
},
149+
{
150+
path: PAGE_PREFIX.RANDOM,
151+
loadComponent: () => import('../features/random/random'),
152+
data: {label: 'Random topic'},
153+
},
151154
...SUB_NAVIGATION_ROUTES,
152155
...API_REFERENCE_ROUTES,
153156
...FOOTER_ROUTES,

0 commit comments

Comments
 (0)