Skip to content

docs: New route for read random article in documentation#68043

Open
aparzi wants to merge 1 commit intoangular:mainfrom
aparzi:feat-randomic-topin-in-adev
Open

docs: New route for read random article in documentation#68043
aparzi wants to merge 1 commit intoangular:mainfrom
aparzi:feat-randomic-topin-in-adev

Conversation

@aparzi
Copy link
Copy Markdown
Contributor

@aparzi aparzi commented Apr 5, 2026

Add random route: 'angular.dev/random' for read random article

Fixed #68038

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

Issue Number: #68038

What is the new behavior?

Add new route '/randon' in angular documentation for read a random article

Does this PR introduce a breaking change?

  • Yes
  • No

@angular-robot angular-robot bot added the area: docs Related to the documentation label Apr 5, 2026
@ngbot ngbot bot added this to the Backlog milestone Apr 5, 2026
@erkamyaman
Copy link
Copy Markdown
Contributor

erkamyaman commented Apr 5, 2026

My idea was to navigate directly to an existing route with a basic function in the search dialogue, like Wikipedia random article feature, I suppose you have a different idea with a new route and a page

Add random route: 'angular.dev/random' for read random article

Fixed angular#68038
@aparzi aparzi force-pushed the feat-randomic-topin-in-adev branch from 67c6485 to d9f55cc Compare April 5, 2026 21:56
@aparzi aparzi marked this pull request as ready for review April 5, 2026 21:57
@pullapprove pullapprove bot requested a review from josephperrott April 5, 2026 21:57
@aparzi
Copy link
Copy Markdown
Contributor Author

aparzi commented Apr 5, 2026

My idea was to navigate directly to an existing route with a basic function in the search dialogue, like Wikipedia random article feature, I suppose you have a different idea with a new route and a page

I wanted to set it up this way for now, and I'd like to see some feedback from the team.

Currently, the random route redirects to a random page.

@erkamyaman
Copy link
Copy Markdown
Contributor

My idea was to navigate directly to an existing route with a basic function in the search dialogue, like Wikipedia random article feature, I suppose you have a different idea with a new route and a page

I wanted to set it up this way for now, and I'd like to see some feedback from the team.

Currently, the random route redirects to a random page.

Tbh I'm excited to see it, as soon as i have a chance, I will have a look, thanks for effort 👌

},
{
path: PAGE_PREFIX.RANDOM,
loadComponent: () => import('../features/random/random'),
Copy link
Copy Markdown
Contributor

@SkyZeroZx SkyZeroZx Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure it’s worth the cost of adding an extra component.

We could just use redirectTo for this: https://angular.dev/guide/routing/redirecting-routes#conditional-redirects

Or maybe browserUrl for this case: https://angular.dev/guide/routing/navigate-to-routes#display-a-different-url-in-the-address-bar

Is there any specific reason to do it this way?

wdyt some like

export const randomRedirectGuard: CanActivateFn = () => {
   // logic to build random URL

  return router.navigateByUrl(random, {
    browserUrl: '/random',
  });
};

export const routes = [
  {
    path: 'random',
    children: [],
    canActivate: [randomRedirectGuard],
   } 
  ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add "Random Topic" button to angular.dev for exploratory learning

3 participants