Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(router): Use correct return type for provideRoutes function #46941

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion goldens/public-api/router/index.md
Expand Up @@ -489,7 +489,7 @@ export abstract class PreloadingStrategy {
export const PRIMARY_OUTLET = "primary";

// @public
export function provideRoutes(routes: Routes): any;
export function provideRoutes(routes: Routes): Provider[];

// @public
export type QueryParamsHandling = 'merge' | 'preserve' | '';
Expand Down
4 changes: 2 additions & 2 deletions packages/router/src/router_module.ts
Expand Up @@ -202,7 +202,7 @@ export function provideForRootGuard(router: Router): any {
*
* @publicApi
*/
export function provideRoutes(routes: Routes): any {
export function provideRoutes(routes: Routes): Provider[] {
return [
{provide: ANALYZE_FOR_ENTRY_COMPONENTS, multi: true, useValue: routes},
{provide: ROUTES, multi: true, useValue: routes},
Expand Down Expand Up @@ -250,7 +250,7 @@ function provideInitialNavigation(config: Pick<ExtraOptions, 'initialNavigation'
];
}

function provideRouterInitializer(): ReadonlyArray<Provider> {
function provideRouterInitializer(): Provider[] {
return [
// ROUTER_INITIALIZER token should be removed. It's public API but shouldn't be. We can just
// have `getBootstrapListener` directly attached to APP_BOOTSTRAP_LISTENER.
Expand Down