@angular/router 21.0.0-next.1 → 21.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/router.mjs +3 -3
- package/fesm2022/router.mjs.map +1 -1
- package/fesm2022/router2.mjs +598 -110
- package/fesm2022/router2.mjs.map +1 -1
- package/fesm2022/router_module.mjs +53 -24
- package/fesm2022/router_module.mjs.map +1 -1
- package/fesm2022/testing.mjs +11 -11
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +1 -1
- package/fesm2022/upgrade.mjs.map +1 -1
- package/index.d.ts +7 -2
- package/package.json +4 -4
- package/router_module.d.d.ts +1 -1
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-next.
|
|
2
|
+
* @license Angular v21.0.0-next.3
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as i3 from '@angular/common';
|
|
8
8
|
import { LOCATION_INITIALIZED, ViewportScroller, LocationStrategy, HashLocationStrategy, Location, PathLocationStrategy } from '@angular/common';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { signal, untracked, inject, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, HostAttributeToken, ɵRuntimeError as _RuntimeError, booleanAttribute, Directive, Attribute, HostBinding, Input, HostListener, EventEmitter, Optional, ContentChildren, Output, Injectable, createEnvironmentInjector, InjectionToken, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, Injector, ApplicationRef, ɵIS_ENABLED_BLOCKING_INITIAL_NAVIGATION as _IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, provideAppInitializer, ɵperformanceMarkFeature as _performanceMarkFeature, ENVIRONMENT_INITIALIZER, NgZone, SkipSelf, NgModule } from '@angular/core';
|
|
10
|
+
import { signal, untracked, inject, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, HostAttributeToken, ɵRuntimeError as _RuntimeError, booleanAttribute, Directive, Attribute, HostBinding, Input, HostListener, EventEmitter, Optional, ContentChildren, Output, Injectable, createEnvironmentInjector, InjectionToken, ɵpublishExternalGlobalUtil as _publishExternalGlobalUtil, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, Injector, ApplicationRef, ɵIS_ENABLED_BLOCKING_INITIAL_NAVIGATION as _IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, provideAppInitializer, ɵperformanceMarkFeature as _performanceMarkFeature, ENVIRONMENT_INITIALIZER, NgZone, SkipSelf, NgModule } from '@angular/core';
|
|
11
11
|
import { ROUTER_CONFIGURATION, NavigationEnd, isUrlTree, Router, ActivatedRoute, RouterConfigLoader, IMPERATIVE_NAVIGATION, NavigationStart, NavigationSkipped, NavigationSkippedCode, Scroll, UrlSerializer, NavigationTransitions, ROUTES, afterNextNavigation, stringifyEvent, NAVIGATION_ERROR_HANDLER, RoutedComponentInputBinder, INPUT_BINDER, CREATE_VIEW_TRANSITION, createViewTransition, VIEW_TRANSITION_OPTIONS, DefaultUrlSerializer, ChildrenOutletContexts, RouterOutlet, ɵEmptyOutletComponent as _EmptyOutletComponent } from './router2.mjs';
|
|
12
12
|
import { Subject, of, from } from 'rxjs';
|
|
13
13
|
import { mergeAll, catchError, filter, concatMap, mergeMap } from 'rxjs/operators';
|
|
@@ -387,10 +387,10 @@ class RouterLink {
|
|
|
387
387
|
preserveFragment: this.preserveFragment,
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
391
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "
|
|
390
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
391
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.0.0-next.3", type: RouterLink, isStandalone: true, selector: "[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", info: "info", relativeTo: "relativeTo", preserveFragment: ["preserveFragment", "preserveFragment", booleanAttribute], skipLocationChange: ["skipLocationChange", "skipLocationChange", booleanAttribute], replaceUrl: ["replaceUrl", "replaceUrl", booleanAttribute], routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.href": "reactiveHref()", "attr.target": "this.target" } }, usesOnChanges: true, ngImport: i0 });
|
|
392
392
|
}
|
|
393
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterLink, decorators: [{
|
|
394
394
|
type: Directive,
|
|
395
395
|
args: [{
|
|
396
396
|
selector: '[routerLink]',
|
|
@@ -646,10 +646,10 @@ class RouterLinkActive {
|
|
|
646
646
|
const isActiveCheckFn = this.isLinkActive(this.router);
|
|
647
647
|
return (this.link && isActiveCheckFn(this.link)) || this.links.some(isActiveCheckFn);
|
|
648
648
|
}
|
|
649
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
650
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
649
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
650
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.0-next.3", type: RouterLinkActive, isStandalone: true, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
|
|
651
651
|
}
|
|
652
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
653
653
|
type: Directive,
|
|
654
654
|
args: [{
|
|
655
655
|
selector: '[routerLinkActive]',
|
|
@@ -700,10 +700,10 @@ class PreloadAllModules {
|
|
|
700
700
|
preload(route, fn) {
|
|
701
701
|
return fn().pipe(catchError(() => of(null)));
|
|
702
702
|
}
|
|
703
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
704
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
703
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
704
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
705
705
|
}
|
|
706
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
707
707
|
type: Injectable,
|
|
708
708
|
args: [{ providedIn: 'root' }]
|
|
709
709
|
}] });
|
|
@@ -720,10 +720,10 @@ class NoPreloading {
|
|
|
720
720
|
preload(route, fn) {
|
|
721
721
|
return of(null);
|
|
722
722
|
}
|
|
723
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
724
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
723
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
724
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
725
725
|
}
|
|
726
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: NoPreloading, decorators: [{
|
|
727
727
|
type: Injectable,
|
|
728
728
|
args: [{ providedIn: 'root' }]
|
|
729
729
|
}] });
|
|
@@ -819,10 +819,10 @@ class RouterPreloader {
|
|
|
819
819
|
}
|
|
820
820
|
});
|
|
821
821
|
}
|
|
822
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
823
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
822
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
823
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterPreloader, providedIn: 'root' });
|
|
824
824
|
}
|
|
825
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
825
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
826
826
|
type: Injectable,
|
|
827
827
|
args: [{ providedIn: 'root' }]
|
|
828
828
|
}], ctorParameters: () => [{ type: Router }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }] });
|
|
@@ -931,13 +931,36 @@ class RouterScroller {
|
|
|
931
931
|
this.routerEventsSubscription?.unsubscribe();
|
|
932
932
|
this.scrollEventsSubscription?.unsubscribe();
|
|
933
933
|
}
|
|
934
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
935
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
934
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
935
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterScroller });
|
|
936
936
|
}
|
|
937
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
937
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterScroller, decorators: [{
|
|
938
938
|
type: Injectable
|
|
939
939
|
}], ctorParameters: () => [{ type: UrlSerializer }, { type: NavigationTransitions }, { type: i3.ViewportScroller }, { type: i0.NgZone }, { type: undefined }] });
|
|
940
940
|
|
|
941
|
+
/**
|
|
942
|
+
* Returns the loaded routes for a given route.
|
|
943
|
+
*/
|
|
944
|
+
function getLoadedRoutes(route) {
|
|
945
|
+
return route._loadedRoutes;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Returns the Router instance from the given injector, or null if not available.
|
|
949
|
+
*/
|
|
950
|
+
function getRouterInstance(injector) {
|
|
951
|
+
return injector.get(Router, null, { optional: true });
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Navigates the given router to the specified URL.
|
|
955
|
+
* Throws if the provided router is not an Angular Router.
|
|
956
|
+
*/
|
|
957
|
+
function navigateByUrl(router, url) {
|
|
958
|
+
if (!(router instanceof Router)) {
|
|
959
|
+
throw new Error('The provided router is not an Angular Router.');
|
|
960
|
+
}
|
|
961
|
+
return router.navigateByUrl(url);
|
|
962
|
+
}
|
|
963
|
+
|
|
941
964
|
/**
|
|
942
965
|
* Sets up providers necessary to enable `Router` functionality for the application.
|
|
943
966
|
* Allows to configure a set of routes as well as extra features that should be enabled.
|
|
@@ -975,6 +998,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2",
|
|
|
975
998
|
* @returns A set of providers to setup a Router.
|
|
976
999
|
*/
|
|
977
1000
|
function provideRouter(routes, ...features) {
|
|
1001
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
1002
|
+
// Publish this util when the router is provided so that the devtools can use it.
|
|
1003
|
+
_publishExternalGlobalUtil('ɵgetLoadedRoutes', getLoadedRoutes);
|
|
1004
|
+
_publishExternalGlobalUtil('ɵgetRouterInstance', getRouterInstance);
|
|
1005
|
+
_publishExternalGlobalUtil('ɵnavigateByUrl', navigateByUrl);
|
|
1006
|
+
}
|
|
978
1007
|
return makeEnvironmentProviders([
|
|
979
1008
|
{ provide: ROUTES, multi: true, useValue: routes },
|
|
980
1009
|
typeof ngDevMode === 'undefined' || ngDevMode
|
|
@@ -1599,11 +1628,11 @@ class RouterModule {
|
|
|
1599
1628
|
providers: [{ provide: ROUTES, multi: true, useValue: routes }],
|
|
1600
1629
|
};
|
|
1601
1630
|
}
|
|
1602
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1603
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1604
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1631
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1632
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent] });
|
|
1633
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterModule });
|
|
1605
1634
|
}
|
|
1606
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1635
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.3", ngImport: i0, type: RouterModule, decorators: [{
|
|
1607
1636
|
type: NgModule,
|
|
1608
1637
|
args: [{
|
|
1609
1638
|
imports: ROUTER_DIRECTIVES,
|