Bumps [@angular/router](https://github.com/angular/angular/tree/HEAD/packages/router) from 20.3.16 to 21.1.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/angular/angular/releases"><code>@angular/router</code>'s releases</a>.</em></p> <blockquote> <h2>VSCode Extension: 21.1.0</h2> <h2>21.1.0 (2026-01-12)</h2> <ul> <li>fix(vscode-extension): convert enum member kind in completions correctly (<a href="50674f8c28">50674f8c28</a>)</li> </ul> <h2>21.1.0</h2> <h3>common</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="d8790972be"><img src="https://img.shields.io/badge/d8790972be-feat-blue" alt="feat - d8790972be" /></a></td> <td>Add custom transformations for Cloudflare and Cloudinary image loaders</td> </tr> <tr> <td><a href="a6b8cb68af"><img src="https://img.shields.io/badge/a6b8cb68af-feat-blue" alt="feat - a6b8cb68af" /></a></td> <td>support custom transformations in ImageKit and Imgix loaders</td> </tr> </tbody> </table> <h3>compiler</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="640693da8e"><img src="https://img.shields.io/badge/640693da8e-feat-blue" alt="feat - 640693da8e" /></a></td> <td>Add support for multiple swich cases matching</td> </tr> <tr> <td><a href="0ad3adc7c6"><img src="https://img.shields.io/badge/0ad3adc7c6-fix-green" alt="fix - 0ad3adc7c6" /></a></td> <td>Support empty cases</td> </tr> </tbody> </table> <h3>core</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="99ad18a4ee"><img src="https://img.shields.io/badge/99ad18a4ee-feat-blue" alt="feat - 99ad18a4ee" /></a></td> <td>Add stability debugging utility</td> </tr> <tr> <td><a href="a0dfa5fa86"><img src="https://img.shields.io/badge/a0dfa5fa86-feat-blue" alt="feat - a0dfa5fa86" /></a></td> <td>support rest arguments in function calls</td> </tr> <tr> <td><a href="6e18fa8bc9"><img src="https://img.shields.io/badge/6e18fa8bc9-feat-blue" alt="feat - 6e18fa8bc9" /></a></td> <td>support spread elements in array literals</td> </tr> <tr> <td><a href="e407280ab5"><img src="https://img.shields.io/badge/e407280ab5-feat-blue" alt="feat - e407280ab5" /></a></td> <td>support spread expressions in object literals</td> </tr> <tr> <td><a href="06be8034bb"><img src="https://img.shields.io/badge/06be8034bb-fix-green" alt="fix - 06be8034bb" /></a></td> <td>Microtask scheduling should be used after any application synchronization</td> </tr> <tr> <td><a href="b4f584cf42"><img src="https://img.shields.io/badge/b4f584cf42-fix-green" alt="fix - b4f584cf42" /></a></td> <td>return <code>StaticProvider</code> for <code>providePlatformInitializer</code></td> </tr> </tbody> </table> <h3>forms</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="1ea5c97703"><img src="https://img.shields.io/badge/1ea5c97703-feat-blue" alt="feat - 1ea5c97703" /></a></td> <td>allow focusing bound control from field state</td> </tr> </tbody> </table> <h3>platform-browser</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="ec9dc94cee"><img src="https://img.shields.io/badge/ec9dc94cee-feat-blue" alt="feat - ec9dc94cee" /></a></td> <td>add <code>context</code> to <code>createApplication</code></td> </tr> <tr> <td><a href="ab67988d2e"><img src="https://img.shields.io/badge/ab67988d2e-feat-blue" alt="feat - ab67988d2e" /></a></td> <td>resolve JIT resources in <code>createApplication</code></td> </tr> </tbody> </table> <h3>router</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="5edceffd04"><img src="https://img.shields.io/badge/5edceffd04-feat-blue" alt="feat - 5edceffd04" /></a></td> <td>add controls for route cleanup</td> </tr> <tr> <td><a href="a03c82564d"><img src="https://img.shields.io/badge/a03c82564d-feat-blue" alt="feat - a03c82564d" /></a></td> <td>Add scroll behavior controls on router navigation</td> </tr> <tr> <td><a href="e44839b016"><img src="https://img.shields.io/badge/e44839b016-feat-blue" alt="feat - e44839b016" /></a></td> <td>Add standalone function to create a comptued for isActive</td> </tr> <tr> <td><a href="c25d749d85"><img src="https://img.shields.io/badge/c25d749d85-feat-blue" alt="feat - c25d749d85" /></a></td> <td>Execute RunGuardsAndResolvers function in injection context</td> </tr> <tr> <td><a href="1c00ab42f8"><img src="https://img.shields.io/badge/1c00ab42f8-feat-blue" alt="feat - 1c00ab42f8" /></a></td> <td>extend paramters of RedirectFunction to include paramMap and queryParamMap</td> </tr> <tr> <td><a href="7003e8d241"><img src="https://img.shields.io/badge/7003e8d241-feat-blue" alt="feat - 7003e8d241" /></a></td> <td>Publish Router's integration with platform Navigation API as experimental</td> </tr> <tr> <td><a href="c84d372778"><img src="https://img.shields.io/badge/c84d372778-feat-blue" alt="feat - c84d372778" /></a></td> <td>Support wildcard params with segments trailing (<a href="https://github.com/angular/angular/tree/HEAD/packages/router/issues/64737">#64737</a>)</td> </tr> </tbody> </table> <h3>upgrade</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="75fe8f8af9"><img src="https://img.shields.io/badge/75fe8f8af9-refactor-yellow" alt="refactor - 75fe8f8af9" /></a></td> <td>deprecate <code>VERSION</code> export</td> </tr> </tbody> </table> <h2>Deprecations</h2> <h3>upgrade</h3> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/angular/angular/blob/main/CHANGELOG.md"><code>@angular/router</code>'s changelog</a>.</em></p> <blockquote> <h1>21.1.0 (2026-01-14)</h1> <h2>Deprecations</h2> <h3>upgrade</h3> <ul> <li><code>VERSION</code> from <code>@angular/upgrade</code> is deprecated. Please use the entry from <code>@angular/upgrade/static</code> instead.</li> </ul> <h3>common</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="d8790972be">d8790972be</a></td> <td>feat</td> <td>Add custom transformations for Cloudflare and Cloudinary image loaders</td> </tr> <tr> <td><a href="a6b8cb68af">a6b8cb68af</a></td> <td>feat</td> <td>support custom transformations in ImageKit and Imgix loaders</td> </tr> </tbody> </table> <h3>compiler</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="640693da8e">640693da8e</a></td> <td>feat</td> <td>Add support for multiple swich cases matching</td> </tr> <tr> <td><a href="0ad3adc7c6">0ad3adc7c6</a></td> <td>fix</td> <td>Support empty cases</td> </tr> </tbody> </table> <h3>core</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="99ad18a4ee">99ad18a4ee</a></td> <td>feat</td> <td>Add stability debugging utility</td> </tr> <tr> <td><a href="a0dfa5fa86">a0dfa5fa86</a></td> <td>feat</td> <td>support rest arguments in function calls</td> </tr> <tr> <td><a href="6e18fa8bc9">6e18fa8bc9</a></td> <td>feat</td> <td>support spread elements in array literals</td> </tr> <tr> <td><a href="e407280ab5">e407280ab5</a></td> <td>feat</td> <td>support spread expressions in object literals</td> </tr> <tr> <td><a href="06be8034bb">06be8034bb</a></td> <td>fix</td> <td>Microtask scheduling should be used after any application synchronization</td> </tr> <tr> <td><a href="b4f584cf42">b4f584cf42</a></td> <td>fix</td> <td>return <code>StaticProvider</code> for <code>providePlatformInitializer</code></td> </tr> </tbody> </table> <h3>forms</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="1ea5c97703">1ea5c97703</a></td> <td>feat</td> <td>allow focusing bound control from field state</td> </tr> </tbody> </table> <h3>platform-browser</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="ec9dc94cee">ec9dc94cee</a></td> <td>feat</td> <td>add <code>context</code> to <code>createApplication</code></td> </tr> <tr> <td><a href="ab67988d2e">ab67988d2e</a></td> <td>feat</td> <td>resolve JIT resources in <code>createApplication</code></td> </tr> </tbody> </table> <h3>router</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="5edceffd04">5edceffd04</a></td> <td>feat</td> <td>add controls for route cleanup</td> </tr> <tr> <td><a href="a03c82564d">a03c82564d</a></td> <td>feat</td> <td>Add scroll behavior controls on router navigation</td> </tr> <tr> <td><a href="e44839b016">e44839b016</a></td> <td>feat</td> <td>Add standalone function to create a comptued for isActive</td> </tr> <tr> <td><a href="c25d749d85">c25d749d85</a></td> <td>feat</td> <td>Execute RunGuardsAndResolvers function in injection context</td> </tr> <tr> <td><a href="1c00ab42f8">1c00ab42f8</a></td> <td>feat</td> <td>extend paramters of RedirectFunction to include paramMap and queryParamMap</td> </tr> <tr> <td><a href="7003e8d241">7003e8d241</a></td> <td>feat</td> <td>Publish Router's integration with platform Navigation API as experimental</td> </tr> <tr> <td><a href="c84d372778">c84d372778</a></td> <td>feat</td> <td>Support wildcard params with segments trailing (<a href="https://redirect.github.com/angular/angular/pull/64737">#64737</a>)</td> </tr> </tbody> </table> <h3>upgrade</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="75fe8f8af9">75fe8f8af9</a></td> <td>refactor</td> <td>deprecate <code>VERSION</code> export</td> </tr> </tbody> </table> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="b1c68e66a7"><code>b1c68e6</code></a> docs: update examples to use <code>isActive</code> instead of deprecated `Router.isActiv...</li> <li><a href="a2b9429992"><code>a2b9429</code></a> Revert "feat(router): add trailingSlash config option"</li> <li><a href="12fccc5e99"><code>12fccc5</code></a> feat(router): add trailingSlash config option</li> <li><a href="7003e8d241"><code>7003e8d</code></a> feat(router): Publish Router's integration with platform Navigation API as ex...</li> <li><a href="9e043decaf"><code>9e043de</code></a> fix(router): handle errors from view transition <code>updateCallbackDone</code> promise</li> <li><a href="bcef77d950"><code>bcef77d</code></a> fix(router): Fix RouterLink href not updating with <code>queryParamsHandling</code></li> <li><a href="1c00ab42f8"><code>1c00ab4</code></a> feat(router): extend paramters of RedirectFunction to include paramMap and qu...</li> <li><a href="97fd1de0ac"><code>97fd1de</code></a> Revert "refactor(router): Add support for precommitHandler in Navigation inte...</li> <li><a href="397dbc4c37"><code>397dbc4</code></a> Revert "refactor(router): Retain original navigateEvent across redirects"</li> <li><a href="e44839b016"><code>e44839b</code></a> feat(router): Add standalone function to create a comptued for isActive</li> <li>Additional commits viewable in <a href="https://github.com/angular/angular/commits/v21.1.0/packages/router">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
ng-flutter
This Angular project is a simple example of how Angular and Flutter web apps could be integrated, and have them interop.
Points of Interest
Angular
This repository is a quite standard Angular app. The following changes were made to be able to use (and interop) with a Flutter web application:
package.jsonhas a customprebuildscript that builds the Flutter web app, so Angular can find it later.flutter.jsis added as a"scripts"entry inangular.json. Angular takes care of minimizing and injecting it as any other script.- The rest of the flutter app
flutter/build/web/is registered as an"assets"entry inangular.json, and moved to/flutter. - The
ng-fluttercomponent takes care of embedding Flutter web, and yielding control to Angular through anappLoadedEventEmitter. The object yielded by this emitter is a state controller exposed by flutter via a JS custom event!
Flutter
The embedded Flutter application lives in the flutter directory of this repo.
That application is a standard web app, that doesn't need to be aware that it's
going to be embedded in another framework.
- Flutter uses new
@staticInteropmethods to allow certain Dart functions to be called from JavaScript. - Look at how
createDartExportandbroadcastAppEventwork together to make the_statecontroller of the Flutter app available to Angular!
How to build the app
Requirements
If you want to build and run this demo on your machine, you'll need a moderately recent version of Angular:
$ ng version
Angular CLI: 17.0.0
Node: 20.9.0
Package Manager: npm 10.1.0
OS: linux x64
And Flutter:
$ flutter --version
Flutter 3.13.9 • channel stable
Framework • revision d211f42860 (2 weeks ago) • 2023-10-25 13:42:25 -0700
Engine • revision 0545f8705d
Tools • Dart 3.1.5 • DevTools 2.25.0
Ensure npm, ng and flutter are present in your $PATH.
Building the app
This repository is a moderately standard Angular app. It integrates
Flutter web by making it part of the Angular assets.
In order to build this app, first fetch its npm dependencies:
$ npm install
added 963 packages, and audited 964 packages in 17s
93 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Then run the build script. It'll take care of building Flutter
automatically:
$ npm run build
> ng-flutter@0.0.0 prebuild
... Flutter web build output ...
Compiling lib/main.dart for the Web...
> ng-flutter@0.0.0 build
> ng build
... Angular build output ...
✔ Browser application bundle generation complete.
✔ Copying assets complete.
✔ Index html generation complete.
Local Angular development
Once you've reached this point, you should be able to work with your Angular application normally, for example to run a local web server:
$ npm run start
> ng-flutter@0.0.0 start
> ng serve
✔ Browser application bundle generation complete.
Initial Chunk Files | Names | Raw Size
vendor.js | vendor | 4.38 MB |
... Angular build output...
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
✔ Compiled successfully.
Navigate to http://localhost:4200/. The application will automatically reload
if you change any of its Angular source files.
Local Flutter web development
The Flutter app lives inside the flutter directory, and can be
developed independently. Just do any changes on Flutter web as you'd
normally do. It even includes a small web/index.html so you can see
changes to your app without running the whole Angular setup.
Note
For now, Angular does not auto-detect changes to your Flutter web app, so once you're happy with your Flutter web app, make sure to call
npm run buildso everything rebuilds and gets placed into its correct location.
Deploying the app
After npm run build, you should have a deployable Angular + Flutter
web app in the dist directory of this Angular project.
Your built app can can be deployed anywhere, but do check Firebase hosting for a super-easy deployment experience!
Troubleshooting
Flutter
Ensure your flutter app is properly rebuilt after any changes.
- Run
npm run buildto re-build the Flutter app.
If you encounter error messages like:
Error: Can't resolve 'flutter/build/web/flutter.js' in '/my/checkout/of/ng-flutter'
You definitely need to run npm run build!
Reach out to the team(s)!
Have you had any problem not covered in this README? Do you want to see other embedding examples?
Let us know by creating an issue or opening a new pull request.
Thanks!