@angular/router 16.0.0-next.5 → 16.0.0-next.6

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.
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.5
2
+ * @license Angular v16.0.0-next.6
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import * as i0 from '@angular/core';
8
- import { ɵisPromise, ɵRuntimeError, Injectable, EventEmitter, inject, ViewContainerRef, ChangeDetectorRef, EnvironmentInjector, Directive, Input, Output, Component, createEnvironmentInjector, ɵisNgModule, isStandalone, ɵisInjectable, InjectionToken, Compiler, InjectFlags, NgModuleFactory, ɵConsole, ɵInitialRenderPendingTasks, NgZone, ɵcoerceToBoolean, ɵɵsanitizeUrlOrResourceUrl, Attribute, HostBinding, HostListener, Optional, ContentChildren, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, ENVIRONMENT_INITIALIZER, Injector, ApplicationRef, APP_INITIALIZER, NgProbeToken, SkipSelf, NgModule, Inject, Version } from '@angular/core';
9
- import { isObservable, from, of, BehaviorSubject, EmptyError, combineLatest, concat, defer, pipe, throwError, EMPTY, ConnectableObservable, Subject } from 'rxjs';
8
+ import { ɵisPromise, ɵRuntimeError, Injectable, EventEmitter, inject, ViewContainerRef, ChangeDetectorRef, EnvironmentInjector, Directive, Input, Output, InjectionToken, reflectComponentType, Component, createEnvironmentInjector, ɵisNgModule, isStandalone, ɵisInjectable, Compiler, InjectFlags, NgModuleFactory, ɵConsole, ɵInitialRenderPendingTasks, NgZone, ɵcoerceToBoolean, ɵɵsanitizeUrlOrResourceUrl, Attribute, HostBinding, HostListener, Optional, ContentChildren, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, ENVIRONMENT_INITIALIZER, Injector, ApplicationRef, APP_INITIALIZER, NgProbeToken, SkipSelf, NgModule, Inject, Version } from '@angular/core';
9
+ import { isObservable, from, of, BehaviorSubject, combineLatest, EmptyError, concat, defer, pipe, throwError, EMPTY, ConnectableObservable, Subject } from 'rxjs';
10
10
  import * as i3 from '@angular/common';
11
11
  import { Location, ViewportScroller, LOCATION_INITIALIZED, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';
12
12
  import { map, switchMap, take, startWith, filter, mergeMap, first, concatMap, tap, catchError, scan, defaultIfEmpty, last as last$1, takeLast, mapTo, finalize, refCount, mergeAll } from 'rxjs/operators';
@@ -419,10 +419,10 @@ function mapChildrenIntoArray(segment, fn) {
419
419
  * @publicApi
420
420
  */
421
421
  class UrlSerializer {
422
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
423
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }); }
422
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
423
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }); }
424
424
  }
425
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: UrlSerializer, decorators: [{
425
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: UrlSerializer, decorators: [{
426
426
  type: Injectable,
427
427
  args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
428
428
  }] });
@@ -1700,6 +1700,79 @@ function stringifyEvent(routerEvent) {
1700
1700
  }
1701
1701
  }
1702
1702
 
1703
+ /**
1704
+ * Store contextual information about a `RouterOutlet`
1705
+ *
1706
+ * @publicApi
1707
+ */
1708
+ class OutletContext {
1709
+ constructor() {
1710
+ this.outlet = null;
1711
+ this.route = null;
1712
+ this.injector = null;
1713
+ this.children = new ChildrenOutletContexts();
1714
+ this.attachRef = null;
1715
+ }
1716
+ }
1717
+ /**
1718
+ * Store contextual information about the children (= nested) `RouterOutlet`
1719
+ *
1720
+ * @publicApi
1721
+ */
1722
+ class ChildrenOutletContexts {
1723
+ constructor() {
1724
+ // contexts for child outlets, by name.
1725
+ this.contexts = new Map();
1726
+ }
1727
+ /** Called when a `RouterOutlet` directive is instantiated */
1728
+ onChildOutletCreated(childName, outlet) {
1729
+ const context = this.getOrCreateContext(childName);
1730
+ context.outlet = outlet;
1731
+ this.contexts.set(childName, context);
1732
+ }
1733
+ /**
1734
+ * Called when a `RouterOutlet` directive is destroyed.
1735
+ * We need to keep the context as the outlet could be destroyed inside a NgIf and might be
1736
+ * re-created later.
1737
+ */
1738
+ onChildOutletDestroyed(childName) {
1739
+ const context = this.getContext(childName);
1740
+ if (context) {
1741
+ context.outlet = null;
1742
+ context.attachRef = null;
1743
+ }
1744
+ }
1745
+ /**
1746
+ * Called when the corresponding route is deactivated during navigation.
1747
+ * Because the component get destroyed, all children outlet are destroyed.
1748
+ */
1749
+ onOutletDeactivated() {
1750
+ const contexts = this.contexts;
1751
+ this.contexts = new Map();
1752
+ return contexts;
1753
+ }
1754
+ onOutletReAttached(contexts) {
1755
+ this.contexts = contexts;
1756
+ }
1757
+ getOrCreateContext(childName) {
1758
+ let context = this.getContext(childName);
1759
+ if (!context) {
1760
+ context = new OutletContext();
1761
+ this.contexts.set(childName, context);
1762
+ }
1763
+ return context;
1764
+ }
1765
+ getContext(childName) {
1766
+ return this.contexts.get(childName) || null;
1767
+ }
1768
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1769
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' }); }
1770
+ }
1771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
1772
+ type: Injectable,
1773
+ args: [{ providedIn: 'root' }]
1774
+ }] });
1775
+
1703
1776
  class Tree {
1704
1777
  constructor(root) {
1705
1778
  this._root = root;
@@ -2182,145 +2255,6 @@ function equalParamsAndUrlSegments(a, b) {
2182
2255
  (!a.parent || equalParamsAndUrlSegments(a.parent, b.parent));
2183
2256
  }
2184
2257
 
2185
- function createRouterState(routeReuseStrategy, curr, prevState) {
2186
- const root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined);
2187
- return new RouterState(root, curr);
2188
- }
2189
- function createNode(routeReuseStrategy, curr, prevState) {
2190
- // reuse an activated route that is currently displayed on the screen
2191
- if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) {
2192
- const value = prevState.value;
2193
- value._futureSnapshot = curr.value;
2194
- const children = createOrReuseChildren(routeReuseStrategy, curr, prevState);
2195
- return new TreeNode(value, children);
2196
- }
2197
- else {
2198
- if (routeReuseStrategy.shouldAttach(curr.value)) {
2199
- // retrieve an activated route that is used to be displayed, but is not currently displayed
2200
- const detachedRouteHandle = routeReuseStrategy.retrieve(curr.value);
2201
- if (detachedRouteHandle !== null) {
2202
- const tree = detachedRouteHandle.route;
2203
- tree.value._futureSnapshot = curr.value;
2204
- tree.children = curr.children.map(c => createNode(routeReuseStrategy, c));
2205
- return tree;
2206
- }
2207
- }
2208
- const value = createActivatedRoute(curr.value);
2209
- const children = curr.children.map(c => createNode(routeReuseStrategy, c));
2210
- return new TreeNode(value, children);
2211
- }
2212
- }
2213
- function createOrReuseChildren(routeReuseStrategy, curr, prevState) {
2214
- return curr.children.map(child => {
2215
- for (const p of prevState.children) {
2216
- if (routeReuseStrategy.shouldReuseRoute(child.value, p.value.snapshot)) {
2217
- return createNode(routeReuseStrategy, child, p);
2218
- }
2219
- }
2220
- return createNode(routeReuseStrategy, child);
2221
- });
2222
- }
2223
- function createActivatedRoute(c) {
2224
- return new ActivatedRoute(new BehaviorSubject(c.url), new BehaviorSubject(c.params), new BehaviorSubject(c.queryParams), new BehaviorSubject(c.fragment), new BehaviorSubject(c.data), c.outlet, c.component, c);
2225
- }
2226
-
2227
- const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
2228
- function redirectingNavigationError(urlSerializer, redirect) {
2229
- const { redirectTo, navigationBehaviorOptions } = isUrlTree(redirect) ? { redirectTo: redirect, navigationBehaviorOptions: undefined } : redirect;
2230
- const error = navigationCancelingError(ngDevMode && `Redirecting to "${urlSerializer.serialize(redirectTo)}"`, 0 /* NavigationCancellationCode.Redirect */, redirect);
2231
- error.url = redirectTo;
2232
- error.navigationBehaviorOptions = navigationBehaviorOptions;
2233
- return error;
2234
- }
2235
- function navigationCancelingError(message, code, redirectUrl) {
2236
- const error = new Error('NavigationCancelingError: ' + (message || ''));
2237
- error[NAVIGATION_CANCELING_ERROR] = true;
2238
- error.cancellationCode = code;
2239
- if (redirectUrl) {
2240
- error.url = redirectUrl;
2241
- }
2242
- return error;
2243
- }
2244
- function isRedirectingNavigationCancelingError$1(error) {
2245
- return isNavigationCancelingError$1(error) && isUrlTree(error.url);
2246
- }
2247
- function isNavigationCancelingError$1(error) {
2248
- return error && error[NAVIGATION_CANCELING_ERROR];
2249
- }
2250
-
2251
- /**
2252
- * Store contextual information about a `RouterOutlet`
2253
- *
2254
- * @publicApi
2255
- */
2256
- class OutletContext {
2257
- constructor() {
2258
- this.outlet = null;
2259
- this.route = null;
2260
- this.injector = null;
2261
- this.children = new ChildrenOutletContexts();
2262
- this.attachRef = null;
2263
- }
2264
- }
2265
- /**
2266
- * Store contextual information about the children (= nested) `RouterOutlet`
2267
- *
2268
- * @publicApi
2269
- */
2270
- class ChildrenOutletContexts {
2271
- constructor() {
2272
- // contexts for child outlets, by name.
2273
- this.contexts = new Map();
2274
- }
2275
- /** Called when a `RouterOutlet` directive is instantiated */
2276
- onChildOutletCreated(childName, outlet) {
2277
- const context = this.getOrCreateContext(childName);
2278
- context.outlet = outlet;
2279
- this.contexts.set(childName, context);
2280
- }
2281
- /**
2282
- * Called when a `RouterOutlet` directive is destroyed.
2283
- * We need to keep the context as the outlet could be destroyed inside a NgIf and might be
2284
- * re-created later.
2285
- */
2286
- onChildOutletDestroyed(childName) {
2287
- const context = this.getContext(childName);
2288
- if (context) {
2289
- context.outlet = null;
2290
- context.attachRef = null;
2291
- }
2292
- }
2293
- /**
2294
- * Called when the corresponding route is deactivated during navigation.
2295
- * Because the component get destroyed, all children outlet are destroyed.
2296
- */
2297
- onOutletDeactivated() {
2298
- const contexts = this.contexts;
2299
- this.contexts = new Map();
2300
- return contexts;
2301
- }
2302
- onOutletReAttached(contexts) {
2303
- this.contexts = contexts;
2304
- }
2305
- getOrCreateContext(childName) {
2306
- let context = this.getContext(childName);
2307
- if (!context) {
2308
- context = new OutletContext();
2309
- this.contexts.set(childName, context);
2310
- }
2311
- return context;
2312
- }
2313
- getContext(childName) {
2314
- return this.contexts.get(childName) || null;
2315
- }
2316
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2317
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' }); }
2318
- }
2319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
2320
- type: Injectable,
2321
- args: [{ providedIn: 'root' }]
2322
- }] });
2323
-
2324
2258
  /**
2325
2259
  * @description
2326
2260
  *
@@ -2398,6 +2332,13 @@ class RouterOutlet {
2398
2332
  this.location = inject(ViewContainerRef);
2399
2333
  this.changeDetector = inject(ChangeDetectorRef);
2400
2334
  this.environmentInjector = inject(EnvironmentInjector);
2335
+ this.inputBinder = inject(INPUT_BINDER, { optional: true });
2336
+ /** @nodoc */
2337
+ this.supportsBindingToComponentInputs = true;
2338
+ }
2339
+ /** @internal */
2340
+ get activatedComponentRef() {
2341
+ return this.activated;
2401
2342
  }
2402
2343
  /** @nodoc */
2403
2344
  ngOnChanges(changes) {
@@ -2423,6 +2364,7 @@ class RouterOutlet {
2423
2364
  if (this.isTrackedInParentContexts(this.name)) {
2424
2365
  this.parentContexts.onChildOutletDestroyed(this.name);
2425
2366
  }
2367
+ this.inputBinder?.unsubscribeFromRouteData(this);
2426
2368
  }
2427
2369
  isTrackedInParentContexts(outletName) {
2428
2370
  return this.parentContexts.getContext(outletName)?.outlet === this;
@@ -2493,6 +2435,7 @@ class RouterOutlet {
2493
2435
  this.activated = ref;
2494
2436
  this._activatedRoute = activatedRoute;
2495
2437
  this.location.insert(ref.hostView);
2438
+ this.inputBinder?.bindActivatedRouteToOutletComponent(this);
2496
2439
  this.attachEvents.emit(ref.instance);
2497
2440
  }
2498
2441
  deactivate() {
@@ -2523,12 +2466,13 @@ class RouterOutlet {
2523
2466
  // Calling `markForCheck` to make sure we will run the change detection when the
2524
2467
  // `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.
2525
2468
  this.changeDetector.markForCheck();
2469
+ this.inputBinder?.bindActivatedRouteToOutletComponent(this);
2526
2470
  this.activateEvents.emit(this.activated.instance);
2527
2471
  }
2528
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2529
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0-next.5", type: RouterOutlet, isStandalone: true, selector: "router-outlet", inputs: { name: "name" }, outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], usesOnChanges: true, ngImport: i0 }); }
2472
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2473
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0-next.6", type: RouterOutlet, isStandalone: true, selector: "router-outlet", inputs: { name: "name" }, outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], usesOnChanges: true, ngImport: i0 }); }
2530
2474
  }
2531
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterOutlet, decorators: [{
2475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterOutlet, decorators: [{
2532
2476
  type: Directive,
2533
2477
  args: [{
2534
2478
  selector: 'router-outlet',
@@ -2566,6 +2510,136 @@ class OutletInjector {
2566
2510
  return this.parent.get(token, notFoundValue);
2567
2511
  }
2568
2512
  }
2513
+ const INPUT_BINDER = new InjectionToken('');
2514
+ /**
2515
+ * Injectable used as a tree-shakable provider for opting in to binding router data to component
2516
+ * inputs.
2517
+ *
2518
+ * The RouterOutlet registers itself with this service when an `ActivatedRoute` is attached or
2519
+ * activated. When this happens, the service subscribes to the `ActivatedRoute` observables (params,
2520
+ * queryParams, data) and sets the inputs of the component using `ComponentRef.setInput`.
2521
+ * Importantly, when an input does not have an item in the route data with a matching key, this
2522
+ * input is set to `undefined`. If it were not done this way, the previous information would be
2523
+ * retained if the data got removed from the route (i.e. if a query parameter is removed).
2524
+ *
2525
+ * The `RouterOutlet` should unregister itself when destroyed via `unsubscribeFromRouteData` so that
2526
+ * the subscriptions are cleaned up.
2527
+ */
2528
+ class RoutedComponentInputBinder {
2529
+ constructor() {
2530
+ this.outletDataSubscriptions = new Map;
2531
+ }
2532
+ bindActivatedRouteToOutletComponent(outlet) {
2533
+ this.unsubscribeFromRouteData(outlet);
2534
+ this.subscribeToRouteData(outlet);
2535
+ }
2536
+ unsubscribeFromRouteData(outlet) {
2537
+ this.outletDataSubscriptions.get(outlet)?.unsubscribe();
2538
+ this.outletDataSubscriptions.delete(outlet);
2539
+ }
2540
+ subscribeToRouteData(outlet) {
2541
+ const { activatedRoute } = outlet;
2542
+ const dataSubscription = combineLatest([
2543
+ activatedRoute.queryParams,
2544
+ activatedRoute.params,
2545
+ activatedRoute.data,
2546
+ ])
2547
+ .pipe(switchMap(([queryParams, params, data]) => {
2548
+ // Promise.resolve is used to avoid synchronously writing the wrong data when two of
2549
+ // the Observables in the `combineLatest` stream emit one after another.
2550
+ return Promise.resolve({ ...queryParams, ...params, ...data });
2551
+ }))
2552
+ .subscribe(data => {
2553
+ // Outlet may have been deactivated or changed names to be associated with a different
2554
+ // route
2555
+ if (!outlet.isActivated || !outlet.activatedComponentRef ||
2556
+ outlet.activatedRoute !== activatedRoute || activatedRoute.component === null) {
2557
+ this.unsubscribeFromRouteData(outlet);
2558
+ return;
2559
+ }
2560
+ const mirror = reflectComponentType(activatedRoute.component);
2561
+ if (!mirror) {
2562
+ this.unsubscribeFromRouteData(outlet);
2563
+ return;
2564
+ }
2565
+ for (const { templateName } of mirror.inputs) {
2566
+ outlet.activatedComponentRef.setInput(templateName, data[templateName]);
2567
+ }
2568
+ });
2569
+ this.outletDataSubscriptions.set(outlet, dataSubscription);
2570
+ }
2571
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RoutedComponentInputBinder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2572
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RoutedComponentInputBinder }); }
2573
+ }
2574
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RoutedComponentInputBinder, decorators: [{
2575
+ type: Injectable
2576
+ }] });
2577
+
2578
+ function createRouterState(routeReuseStrategy, curr, prevState) {
2579
+ const root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined);
2580
+ return new RouterState(root, curr);
2581
+ }
2582
+ function createNode(routeReuseStrategy, curr, prevState) {
2583
+ // reuse an activated route that is currently displayed on the screen
2584
+ if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) {
2585
+ const value = prevState.value;
2586
+ value._futureSnapshot = curr.value;
2587
+ const children = createOrReuseChildren(routeReuseStrategy, curr, prevState);
2588
+ return new TreeNode(value, children);
2589
+ }
2590
+ else {
2591
+ if (routeReuseStrategy.shouldAttach(curr.value)) {
2592
+ // retrieve an activated route that is used to be displayed, but is not currently displayed
2593
+ const detachedRouteHandle = routeReuseStrategy.retrieve(curr.value);
2594
+ if (detachedRouteHandle !== null) {
2595
+ const tree = detachedRouteHandle.route;
2596
+ tree.value._futureSnapshot = curr.value;
2597
+ tree.children = curr.children.map(c => createNode(routeReuseStrategy, c));
2598
+ return tree;
2599
+ }
2600
+ }
2601
+ const value = createActivatedRoute(curr.value);
2602
+ const children = curr.children.map(c => createNode(routeReuseStrategy, c));
2603
+ return new TreeNode(value, children);
2604
+ }
2605
+ }
2606
+ function createOrReuseChildren(routeReuseStrategy, curr, prevState) {
2607
+ return curr.children.map(child => {
2608
+ for (const p of prevState.children) {
2609
+ if (routeReuseStrategy.shouldReuseRoute(child.value, p.value.snapshot)) {
2610
+ return createNode(routeReuseStrategy, child, p);
2611
+ }
2612
+ }
2613
+ return createNode(routeReuseStrategy, child);
2614
+ });
2615
+ }
2616
+ function createActivatedRoute(c) {
2617
+ return new ActivatedRoute(new BehaviorSubject(c.url), new BehaviorSubject(c.params), new BehaviorSubject(c.queryParams), new BehaviorSubject(c.fragment), new BehaviorSubject(c.data), c.outlet, c.component, c);
2618
+ }
2619
+
2620
+ const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
2621
+ function redirectingNavigationError(urlSerializer, redirect) {
2622
+ const { redirectTo, navigationBehaviorOptions } = isUrlTree(redirect) ? { redirectTo: redirect, navigationBehaviorOptions: undefined } : redirect;
2623
+ const error = navigationCancelingError(ngDevMode && `Redirecting to "${urlSerializer.serialize(redirectTo)}"`, 0 /* NavigationCancellationCode.Redirect */, redirect);
2624
+ error.url = redirectTo;
2625
+ error.navigationBehaviorOptions = navigationBehaviorOptions;
2626
+ return error;
2627
+ }
2628
+ function navigationCancelingError(message, code, redirectUrl) {
2629
+ const error = new Error('NavigationCancelingError: ' + (message || ''));
2630
+ error[NAVIGATION_CANCELING_ERROR] = true;
2631
+ error.cancellationCode = code;
2632
+ if (redirectUrl) {
2633
+ error.url = redirectUrl;
2634
+ }
2635
+ return error;
2636
+ }
2637
+ function isRedirectingNavigationCancelingError$1(error) {
2638
+ return isNavigationCancelingError$1(error) && isUrlTree(error.url);
2639
+ }
2640
+ function isNavigationCancelingError$1(error) {
2641
+ return error && error[NAVIGATION_CANCELING_ERROR];
2642
+ }
2569
2643
 
2570
2644
  /**
2571
2645
  * This component is used internally within the router to be a placeholder when an empty
@@ -2577,10 +2651,10 @@ class OutletInjector {
2577
2651
  * to this `EmptyOutletComponent`.
2578
2652
  */
2579
2653
  class ɵEmptyOutletComponent {
2580
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2581
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0-next.5", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
2654
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2655
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0-next.6", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
2582
2656
  }
2583
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2584
2658
  type: Component,
2585
2659
  args: [{
2586
2660
  template: `<router-outlet></router-outlet>`,
@@ -2776,17 +2850,19 @@ function getClosestRouteInjector(snapshot) {
2776
2850
  return null;
2777
2851
  }
2778
2852
 
2779
- const activateRoutes = (rootContexts, routeReuseStrategy, forwardEvent) => map(t => {
2780
- new ActivateRoutes(routeReuseStrategy, t.targetRouterState, t.currentRouterState, forwardEvent)
2853
+ let warnedAboutUnsupportedInputBinding = false;
2854
+ const activateRoutes = (rootContexts, routeReuseStrategy, forwardEvent, inputBindingEnabled) => map(t => {
2855
+ new ActivateRoutes(routeReuseStrategy, t.targetRouterState, t.currentRouterState, forwardEvent, inputBindingEnabled)
2781
2856
  .activate(rootContexts);
2782
2857
  return t;
2783
2858
  });
2784
2859
  class ActivateRoutes {
2785
- constructor(routeReuseStrategy, futureState, currState, forwardEvent) {
2860
+ constructor(routeReuseStrategy, futureState, currState, forwardEvent, inputBindingEnabled) {
2786
2861
  this.routeReuseStrategy = routeReuseStrategy;
2787
2862
  this.futureState = futureState;
2788
2863
  this.currState = currState;
2789
2864
  this.forwardEvent = forwardEvent;
2865
+ this.inputBindingEnabled = inputBindingEnabled;
2790
2866
  }
2791
2867
  activate(parentContexts) {
2792
2868
  const futureRoot = this.futureState._root;
@@ -2941,6 +3017,16 @@ class ActivateRoutes {
2941
3017
  this.activateChildRoutes(futureNode, null, parentContexts);
2942
3018
  }
2943
3019
  }
3020
+ if ((typeof ngDevMode === 'undefined' || ngDevMode)) {
3021
+ const context = parentContexts.getOrCreateContext(future.outlet);
3022
+ const outlet = context.outlet;
3023
+ if (outlet && this.inputBindingEnabled && !outlet.supportsBindingToComponentInputs &&
3024
+ !warnedAboutUnsupportedInputBinding) {
3025
+ console.warn(`'withComponentInputBinding' feature is enabled but ` +
3026
+ `this application is using an outlet that may not support binding to component inputs.`);
3027
+ warnedAboutUnsupportedInputBinding = true;
3028
+ }
3029
+ }
2944
3030
  }
2945
3031
  }
2946
3032
 
@@ -4042,10 +4128,10 @@ class RouterConfigLoader {
4042
4128
  }
4043
4129
  }));
4044
4130
  }
4045
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterConfigLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4046
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' }); }
4131
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterConfigLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4132
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' }); }
4047
4133
  }
4048
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterConfigLoader, decorators: [{
4134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterConfigLoader, decorators: [{
4049
4135
  type: Injectable,
4050
4136
  args: [{ providedIn: 'root' }]
4051
4137
  }] });
@@ -4073,6 +4159,7 @@ class NavigationTransitions {
4073
4159
  this.environmentInjector = inject(EnvironmentInjector);
4074
4160
  this.urlSerializer = inject(UrlSerializer);
4075
4161
  this.rootContexts = inject(ChildrenOutletContexts);
4162
+ this.inputBindingEnabled = inject(INPUT_BINDER, { optional: true }) !== null;
4076
4163
  this.navigationId = 0;
4077
4164
  /**
4078
4165
  * Hook that enables you to pause navigation after the preactivation phase.
@@ -4322,7 +4409,11 @@ class NavigationTransitions {
4322
4409
  }
4323
4410
  router.browserUrlTree = t.urlAfterRedirects;
4324
4411
  }
4325
- }), activateRoutes(this.rootContexts, router.routeReuseStrategy, (evt) => this.events.next(evt)), tap({
4412
+ }), activateRoutes(this.rootContexts, router.routeReuseStrategy, (evt) => this.events.next(evt), this.inputBindingEnabled),
4413
+ // Ensure that if some observable used to drive the transition doesn't
4414
+ // complete, the navigation still finalizes This should never happen, but
4415
+ // this is done as a safety measure to avoid surfacing this error (#49567).
4416
+ take(1), tap({
4326
4417
  next: (t) => {
4327
4418
  completed = true;
4328
4419
  this.lastSuccessfulNavigation = this.currentNavigation;
@@ -4416,10 +4507,10 @@ class NavigationTransitions {
4416
4507
  this.events.next(navCancel);
4417
4508
  t.resolve(false);
4418
4509
  }
4419
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: NavigationTransitions, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4420
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: NavigationTransitions, providedIn: 'root' }); }
4510
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: NavigationTransitions, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4511
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: NavigationTransitions, providedIn: 'root' }); }
4421
4512
  }
4422
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: NavigationTransitions, decorators: [{
4513
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: NavigationTransitions, decorators: [{
4423
4514
  type: Injectable,
4424
4515
  args: [{ providedIn: 'root' }]
4425
4516
  }], ctorParameters: function () { return []; } });
@@ -4470,10 +4561,10 @@ class TitleStrategy {
4470
4561
  getResolvedTitleForRoute(snapshot) {
4471
4562
  return snapshot.data[RouteTitleKey];
4472
4563
  }
4473
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4474
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }); }
4564
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4565
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }); }
4475
4566
  }
4476
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: TitleStrategy, decorators: [{
4567
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: TitleStrategy, decorators: [{
4477
4568
  type: Injectable,
4478
4569
  args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
4479
4570
  }] });
@@ -4496,10 +4587,10 @@ class DefaultTitleStrategy extends TitleStrategy {
4496
4587
  this.title.setTitle(title);
4497
4588
  }
4498
4589
  }
4499
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
4500
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' }); }
4590
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
4591
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' }); }
4501
4592
  }
4502
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
4593
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
4503
4594
  type: Injectable,
4504
4595
  args: [{ providedIn: 'root' }]
4505
4596
  }], ctorParameters: function () { return [{ type: i1.Title }]; } });
@@ -4512,10 +4603,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5",
4512
4603
  * @publicApi
4513
4604
  */
4514
4605
  class RouteReuseStrategy {
4515
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouteReuseStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4516
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouteReuseStrategy, providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }); }
4606
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouteReuseStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4607
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouteReuseStrategy, providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }); }
4517
4608
  }
4518
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouteReuseStrategy, decorators: [{
4609
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouteReuseStrategy, decorators: [{
4519
4610
  type: Injectable,
4520
4611
  args: [{ providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }]
4521
4612
  }] });
@@ -4566,10 +4657,10 @@ class BaseRouteReuseStrategy {
4566
4657
  }
4567
4658
  }
4568
4659
  class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
4569
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: DefaultRouteReuseStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
4570
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: DefaultRouteReuseStrategy, providedIn: 'root' }); }
4660
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: DefaultRouteReuseStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
4661
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: DefaultRouteReuseStrategy, providedIn: 'root' }); }
4571
4662
  }
4572
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: DefaultRouteReuseStrategy, decorators: [{
4663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: DefaultRouteReuseStrategy, decorators: [{
4573
4664
  type: Injectable,
4574
4665
  args: [{ providedIn: 'root' }]
4575
4666
  }] });
@@ -4592,10 +4683,10 @@ const ROUTER_CONFIGURATION = new InjectionToken((typeof ngDevMode === 'undefined
4592
4683
  * @publicApi
4593
4684
  */
4594
4685
  class UrlHandlingStrategy {
4595
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: UrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4596
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: UrlHandlingStrategy, providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }); }
4686
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: UrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4687
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: UrlHandlingStrategy, providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }); }
4597
4688
  }
4598
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: UrlHandlingStrategy, decorators: [{
4689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: UrlHandlingStrategy, decorators: [{
4599
4690
  type: Injectable,
4600
4691
  args: [{ providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }]
4601
4692
  }] });
@@ -4612,10 +4703,10 @@ class DefaultUrlHandlingStrategy {
4612
4703
  merge(newUrlPart, wholeUrl) {
4613
4704
  return newUrlPart;
4614
4705
  }
4615
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: DefaultUrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4616
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: DefaultUrlHandlingStrategy, providedIn: 'root' }); }
4706
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: DefaultUrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4707
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: DefaultUrlHandlingStrategy, providedIn: 'root' }); }
4617
4708
  }
4618
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: DefaultUrlHandlingStrategy, decorators: [{
4709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: DefaultUrlHandlingStrategy, decorators: [{
4619
4710
  type: Injectable,
4620
4711
  args: [{ providedIn: 'root' }]
4621
4712
  }] });
@@ -4846,6 +4937,13 @@ class Router {
4846
4937
  this.navigationTransitions = inject(NavigationTransitions);
4847
4938
  this.urlSerializer = inject(UrlSerializer);
4848
4939
  this.location = inject(Location);
4940
+ /**
4941
+ * Indicates whether the the application has opted in to binding Router data to component inputs.
4942
+ *
4943
+ * This option is enabled by the `withComponentInputBinding` feature of `provideRouter` or
4944
+ * `bindToComponentInputs` in the `ExtraOptions` of `RouterModule.forRoot`.
4945
+ */
4946
+ this.componentInputBindingEnabled = !!inject(INPUT_BINDER, { optional: true });
4849
4947
  this.isNgZoneEnabled = inject(NgZone) instanceof NgZone && NgZone.isInAngularZone();
4850
4948
  this.resetConfig(this.config);
4851
4949
  this.currentUrlTree = new UrlTree();
@@ -5102,9 +5200,6 @@ class Router {
5102
5200
  if (this.isNgZoneEnabled && !NgZone.isInAngularZone()) {
5103
5201
  this.console.warn(`Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?`);
5104
5202
  }
5105
- if (url instanceof UrlTree && url._warnIfUsedForNavigation) {
5106
- this.console.warn(url._warnIfUsedForNavigation);
5107
- }
5108
5203
  }
5109
5204
  const urlTree = isUrlTree(url) ? url : this.parseUrl(url);
5110
5205
  const mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);
@@ -5332,10 +5427,10 @@ class Router {
5332
5427
  }
5333
5428
  return { navigationId };
5334
5429
  }
5335
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: Router, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5336
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: Router, providedIn: 'root' }); }
5430
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: Router, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5431
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: Router, providedIn: 'root' }); }
5337
5432
  }
5338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: Router, decorators: [{
5433
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: Router, decorators: [{
5339
5434
  type: Injectable,
5340
5435
  args: [{ providedIn: 'root' }]
5341
5436
  }], ctorParameters: function () { return []; } });
@@ -5621,10 +5716,10 @@ class RouterLink {
5621
5716
  preserveFragment: this.preserveFragment,
5622
5717
  });
5623
5718
  }
5624
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", 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 }); }
5625
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0-next.5", type: RouterLink, isStandalone: true, selector: "[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target" } }, usesOnChanges: true, ngImport: i0 }); }
5719
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", 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 }); }
5720
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0-next.6", type: RouterLink, isStandalone: true, selector: "[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target" } }, usesOnChanges: true, ngImport: i0 }); }
5626
5721
  }
5627
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterLink, decorators: [{
5722
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterLink, decorators: [{
5628
5723
  type: Directive,
5629
5724
  args: [{
5630
5725
  selector: '[routerLink]',
@@ -5844,10 +5939,10 @@ class RouterLinkActive {
5844
5939
  const isActiveCheckFn = this.isLinkActive(this.router);
5845
5940
  return this.link && isActiveCheckFn(this.link) || this.links.some(isActiveCheckFn);
5846
5941
  }
5847
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
5848
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0-next.5", 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 }); }
5942
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
5943
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0-next.6", 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 }); }
5849
5944
  }
5850
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterLinkActive, decorators: [{
5945
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterLinkActive, decorators: [{
5851
5946
  type: Directive,
5852
5947
  args: [{
5853
5948
  selector: '[routerLinkActive]',
@@ -5899,10 +5994,10 @@ class PreloadAllModules {
5899
5994
  preload(route, fn) {
5900
5995
  return fn().pipe(catchError(() => of(null)));
5901
5996
  }
5902
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5903
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: PreloadAllModules, providedIn: 'root' }); }
5997
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5998
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: PreloadAllModules, providedIn: 'root' }); }
5904
5999
  }
5905
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: PreloadAllModules, decorators: [{
6000
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: PreloadAllModules, decorators: [{
5906
6001
  type: Injectable,
5907
6002
  args: [{ providedIn: 'root' }]
5908
6003
  }] });
@@ -5919,10 +6014,10 @@ class NoPreloading {
5919
6014
  preload(route, fn) {
5920
6015
  return of(null);
5921
6016
  }
5922
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5923
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: NoPreloading, providedIn: 'root' }); }
6017
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6018
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: NoPreloading, providedIn: 'root' }); }
5924
6019
  }
5925
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: NoPreloading, decorators: [{
6020
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: NoPreloading, decorators: [{
5926
6021
  type: Injectable,
5927
6022
  args: [{ providedIn: 'root' }]
5928
6023
  }] });
@@ -6015,10 +6110,10 @@ class RouterPreloader {
6015
6110
  }
6016
6111
  });
6017
6112
  }
6018
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable }); }
6019
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterPreloader, providedIn: 'root' }); }
6113
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable }); }
6114
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterPreloader, providedIn: 'root' }); }
6020
6115
  }
6021
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterPreloader, decorators: [{
6116
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterPreloader, decorators: [{
6022
6117
  type: Injectable,
6023
6118
  args: [{ providedIn: 'root' }]
6024
6119
  }], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
@@ -6111,10 +6206,10 @@ class RouterScroller {
6111
6206
  this.routerEventsSubscription?.unsubscribe();
6112
6207
  this.scrollEventsSubscription?.unsubscribe();
6113
6208
  }
6114
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable }); }
6115
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterScroller }); }
6209
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable }); }
6210
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterScroller }); }
6116
6211
  }
6117
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterScroller, decorators: [{
6212
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterScroller, decorators: [{
6118
6213
  type: Injectable
6119
6214
  }], ctorParameters: function () { return [{ type: UrlSerializer }, { type: NavigationTransitions }, { type: i3.ViewportScroller }, { type: i0.NgZone }, { type: undefined }]; } });
6120
6215
 
@@ -6269,6 +6364,7 @@ function getBootstrapListener() {
6269
6364
  router.resetRootComponentType(ref.componentTypes[0]);
6270
6365
  if (!bootstrapDone.closed) {
6271
6366
  bootstrapDone.next();
6367
+ bootstrapDone.complete();
6272
6368
  bootstrapDone.unsubscribe();
6273
6369
  }
6274
6370
  };
@@ -6575,6 +6671,33 @@ function withNavigationErrorHandler(fn) {
6575
6671
  }];
6576
6672
  return routerFeature(7 /* RouterFeatureKind.NavigationErrorHandlerFeature */, providers);
6577
6673
  }
6674
+ /**
6675
+ * Enables binding information from the `Router` state directly to the inputs of the component in
6676
+ * `Route` configurations.
6677
+ *
6678
+ * @usageNotes
6679
+ *
6680
+ * Basic example of how you can enable the feature:
6681
+ * ```
6682
+ * const appRoutes: Routes = [];
6683
+ * bootstrapApplication(AppComponent,
6684
+ * {
6685
+ * providers: [
6686
+ * provideRouter(appRoutes, withComponentInputBinding())
6687
+ * ]
6688
+ * }
6689
+ * );
6690
+ * ```
6691
+ *
6692
+ * @returns A set of providers for use with `provideRouter`.
6693
+ */
6694
+ function withComponentInputBinding() {
6695
+ const providers = [
6696
+ RoutedComponentInputBinder,
6697
+ { provide: INPUT_BINDER, useExisting: RoutedComponentInputBinder },
6698
+ ];
6699
+ return routerFeature(8 /* RouterFeatureKind.ComponentInputBindingFeature */, providers);
6700
+ }
6578
6701
 
6579
6702
  /**
6580
6703
  * The directives defined in the `RouterModule`.
@@ -6665,6 +6788,7 @@ class RouterModule {
6665
6788
  config?.preloadingStrategy ? withPreloading(config.preloadingStrategy).ɵproviders : [],
6666
6789
  { provide: NgProbeToken, multi: true, useFactory: routerNgProbeToken },
6667
6790
  config?.initialNavigation ? provideInitialNavigation(config) : [],
6791
+ config?.bindToComponentInputs ? withComponentInputBinding().ɵproviders : [],
6668
6792
  provideRouterInitializer(),
6669
6793
  ],
6670
6794
  };
@@ -6691,11 +6815,11 @@ class RouterModule {
6691
6815
  providers: [{ provide: ROUTES, multi: true, useValue: routes }],
6692
6816
  };
6693
6817
  }
6694
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
6695
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] }); }
6696
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterModule, imports: [ɵEmptyOutletComponent] }); }
6818
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
6819
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] }); }
6820
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterModule, imports: [ɵEmptyOutletComponent] }); }
6697
6821
  }
6698
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.5", ngImport: i0, type: RouterModule, decorators: [{
6822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0-next.6", ngImport: i0, type: RouterModule, decorators: [{
6699
6823
  type: NgModule,
6700
6824
  args: [{
6701
6825
  imports: ROUTER_DIRECTIVES,
@@ -6840,7 +6964,7 @@ function mapToResolve(provider) {
6840
6964
  /**
6841
6965
  * @publicApi
6842
6966
  */
6843
- const VERSION = new Version('16.0.0-next.5');
6967
+ const VERSION = new Version('16.0.0-next.6');
6844
6968
 
6845
6969
  /**
6846
6970
  * @module
@@ -6855,5 +6979,5 @@ const VERSION = new Version('16.0.0-next.5');
6855
6979
  * Generated bundle index. Do not edit.
6856
6980
  */
6857
6981
 
6858
- export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationSkipped, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, createUrlTreeFromSnapshot, defaultUrlMatcher, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve, provideRouter, provideRoutes, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withHashLocation, withInMemoryScrolling, withNavigationErrorHandler, withPreloading, withRouterConfig, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, afterNextNavigation as ɵafterNextNavigation, withPreloading as ɵwithPreloading };
6982
+ export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationSkipped, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, createUrlTreeFromSnapshot, defaultUrlMatcher, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve, provideRouter, provideRoutes, withComponentInputBinding, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withHashLocation, withInMemoryScrolling, withNavigationErrorHandler, withPreloading, withRouterConfig, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, afterNextNavigation as ɵafterNextNavigation, withPreloading as ɵwithPreloading };
6859
6983
  //# sourceMappingURL=router.mjs.map