Skip to content

Commit

Permalink
fixup! feat(router): Create APIs for using Router without RouterModule
Browse files Browse the repository at this point in the history
  • Loading branch information
atscott authored and AndrewKushnir committed Aug 9, 2022
1 parent c3da7e1 commit 7b05799
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 57 deletions.
22 changes: 11 additions & 11 deletions goldens/public-api/router/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export type Data = {
[key: string | symbol]: any;
};

// @public (undocumented)
// @public
export type DebugTracingFeature = Provider[];

// @public
Expand All @@ -237,10 +237,10 @@ export class DefaultUrlSerializer implements UrlSerializer {
// @public
export type DetachedRouteHandle = {};

// @public (undocumented)
// @public
export type DisabledInitialNavigationFeature = Provider[];

// @public (undocumented)
// @public
export type EnabledBlockingInitialNavigationFeature = Provider[];

// @public
Expand Down Expand Up @@ -506,7 +506,7 @@ export class PreloadAllModules implements PreloadingStrategy {
static ɵprov: i0.ɵɵInjectableDeclaration<PreloadAllModules>;
}

// @public (undocumented)
// @public
export type PreloadingFeature = Provider[];

// @public
Expand Down Expand Up @@ -669,7 +669,7 @@ export const ROUTER_CONFIGURATION: InjectionToken<ExtraOptions>;
// @public
export const ROUTER_INITIALIZER: InjectionToken<(compRef: ComponentRef<any>) => void>;

// @public (undocumented)
// @public
export type RouterConfigurationFeature = Provider[];

// @public
Expand All @@ -690,7 +690,7 @@ export class RouterEvent {
url: string;
}

// @public (undocumented)
// @public
export type RouterFeatures = PreloadingFeature | DebugTracingFeature | InitialNavigationFeature | InMemoryScrollingFeature | RouterConfigurationFeature;

// @public
Expand Down Expand Up @@ -1014,22 +1014,22 @@ export class UrlTree {
// @public (undocumented)
export const VERSION: Version;

// @public (undocumented)
// @public
export function withDebugTracing(): DebugTracingFeature;

// @public (undocumented)
// @public
export function withDisabledInitialNavigation(): DisabledInitialNavigationFeature;

// @public (undocumented)
// @public
export function withEnabledBlockingInitialNavigation(): EnabledBlockingInitialNavigationFeature;

// @public
export function withInMemoryScrolling(options?: Pick<ExtraOptions, 'anchorScrolling' | 'scrollPositionRestoration'>): InMemoryScrollingFeature;

// @public (undocumented)
// @public
export function withPreloading(preloadingStrategy: Type<PreloadingStrategy>): PreloadingFeature;

// @public (undocumented)
// @public
export function withRouterConfig(options: Pick<ExtraOptions, 'canceledNavigationResolution' | 'onSameUrlNavigation' | 'paramsInheritanceStrategy' | 'urlUpdateStrategy'>): RouterConfigurationFeature;

// (No @packageDocumentation comment for this package)
Expand Down
2 changes: 1 addition & 1 deletion goldens/public-api/router/testing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TitleStrategy } from '@angular/router';
import { UrlHandlingStrategy } from '@angular/router';
import { UrlSerializer } from '@angular/router';

// @public (undocumented)
// @public
export function provideRouterForTesting(routes?: Routes, ...features: RouterFeatures[]): Provider[];

// @public
Expand Down
10 changes: 5 additions & 5 deletions goldens/size-tracking/integration-payloads.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
"cli-hello-world-ivy-i18n": {
"uncompressed": {
"runtime": 926,
"main": 124910,
"polyfills": 35252
"main": 124860,
"polyfills": 35246
}
},
"cli-hello-world-lazy": {
"uncompressed": {
"runtime": 2835,
"main": 238737,
"main": 226893,
"polyfills": 33842,
"src_app_lazy_lazy_module_ts": 780
"src_app_lazy_lazy_routes_ts": 487
}
},
"forms": {
Expand All @@ -48,7 +48,7 @@
"animations": {
"uncompressed": {
"runtime": 1070,
"main": 157064,
"main": 156816,
"polyfills": 33814
}
},
Expand Down
3 changes: 2 additions & 1 deletion integration/cli-hello-world-lazy/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {CommonModule} from '@angular/common';
import {Component} from '@angular/core';
import {RouterOutlet} from '@angular/router';

@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet],
imports: [RouterOutlet, CommonModule],
templateUrl: './app.component.html',
})
export class AppComponent {
Expand Down
3 changes: 2 additions & 1 deletion integration/cli-hello-world-lazy/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {enableProdMode} from '@angular/core';
import {bootstrapApplication} from '@angular/platform-browser';
import {bootstrapApplication, provideProtractorTestingSupport} from '@angular/platform-browser';
import {provideRouter} from '@angular/router';

import {AppComponent} from './app/app.component';
Expand All @@ -13,5 +13,6 @@ if (environment.production) {
bootstrapApplication(AppComponent, {
providers: [
provideRouter(appRoutes),
provideProtractorTestingSupport(),
]
}).catch(console.error);

0 comments on commit 7b05799

Please sign in to comment.