What is @angular/platform-browser-dynamic?
The @angular/platform-browser-dynamic npm package provides methods for bootstrapping Angular applications in a browser environment with Just-In-Time (JIT) compilation. This package is typically used for development purposes, as it compiles the application dynamically in the browser, allowing for a faster development cycle. However, for production builds, Ahead-Of-Time (AOT) compilation is preferred for performance reasons, which is handled by the @angular/platform-browser package.
What are @angular/platform-browser-dynamic's main functionalities?
Bootstrapping Angular Modules
This code snippet demonstrates how to bootstrap an Angular module using the platformBrowserDynamic function. It imports the AppModule and then calls the bootstrapModule method to initialize the application.
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
Other packages similar to @angular/platform-browser-dynamic
@angular/platform-browser
This package provides tools for running Angular applications in a web browser with Ahead-Of-Time (AOT) compilation. Unlike @angular/platform-browser-dynamic, it is optimized for production by pre-compiling templates to make the application load faster and be more performant.
react-dom
Similar to @angular/platform-browser-dynamic for Angular, react-dom is used for bootstrapping and rendering React applications in the browser. It provides the entry point to the DOM and server renderers for React and can be considered an equivalent in the React ecosystem.
vue
The Vue.js framework has a similar package for bootstrapping and rendering Vue applications in the browser. It provides the functionality to create and mount the root Vue instance to the DOM, similar to how Angular applications are bootstrapped with @angular/platform-browser-dynamic.
15.1.0 (2023-01-10)
Deprecations
router
-
CanLoad guards in the Router are deprecated. Use CanMatch
instead.
-
router writable properties
The following strategies are meant to be configured by registering the
application strategy in DI via the providers
in the root NgModule
or
bootstrapApplication
:
routeReuseStrategy
titleStrategy
urlHandlingStrategy
The following options are meant to be configured using the options
available in RouterModule.forRoot
or provideRouter
.
onSameUrlNavigation
paramsInheritanceStrategy
urlUpdateStrategy
canceledNavigationResolution
The following options are available in RouterModule.forRoot
but not
available in provideRouter
:
malformedUriErrorHandler
- This was found to not be used anywhere
internally.errorHandler
- Developers can instead subscribe to Router.events
and filter for NavigationError
.
common
| Commit | Type | Description |
| -- | -- | -- |
| fe50813664 | feat | Add BrowserPlatformLocation to the public API (#48488) |
| 2f4f0638c7 | fix | Add data attribtue to NgOptimizedImage (#48497) |
compiler
| Commit | Type | Description |
| -- | -- | -- |
| a532d71975 | feat | allow self-closing tags on custom elements (#48535) |
| caf7228f8a | fix | resolve deprecation warning (#48652) |
| 33f35b04ef | fix | type-only symbols incorrectly retained when downlevelling custom decorators (#48638) |
compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| caedef0f5b | fix | update @babel/core
dependency and lock version (#48634) |
core
| Commit | Type | Description |
| -- | -- | -- |
| 6acae1477a | feat | Add TestBed.runInInjectionContext
to help test functions which use inject
(#47955) |
| 38421578a2 | feat | Make the isStandalone()
function available in public API (#48114) |
| dd42974b07 | feat | support TypeScript 4.9 (#48005) |
forms
| Commit | Type | Description |
| -- | -- | -- |
| 8aa8b4b77c | fix | Form provider FormsModule.withConfig return a FormsModule (#48526) |
language-service
| Commit | Type | Description |
| -- | -- | -- |
| 5f0b53c735 | feat | Allow auto-imports to suggest multiple possible imports. (#47787) |
| 6a8ea29a04 | fix | expose package.json
for vscode extension resolution (#48678) |
| ce8160ecb2 | fix | Prevent crashes on unemitable references (#47938) |
| e615b598ba | fix | ship /api
entry-point (#48670) |
| 6ce7d76a0e | fix | update packages/language-service/build.sh script to work with vscode-ng-language-service's new Bazel build (#48663) |
localize
| Commit | Type | Description |
| -- | -- | -- |
| a1a8e91eca | fix | add triple slash type reference on @angular/localize
on `ng add (#48502) |
migrations
| Commit | Type | Description |
| -- | -- | -- |
| cc284afbbc | fix | combine newly-added imports in import manager (#48620) |
router
| Commit | Type | Description |
| -- | -- | -- |
| 228e992db7 | docs | Deprecate canLoad guards in favor of canMatch (#48180) |
| 0a8b8a66cd | docs | Deprecate public members of Router that are meant to be configured elsewhere (#48006) |
| 332461bd0c | feat | Add ability to override onSameUrlNavigation
default per-navigation (#48050) |
| f58ad86e51 | feat | Add feature provider for enabling hash navigation (#48301) |
| 73f03ad2d2 | feat | Add new NavigationSkipped event for ignored navigations (#48024) |
| 3fe75710d9 | fix | page refresh should not destroy history state (#48540) |
Special Thanks
Alan Agius, Alex Castle, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Bob Watson, Charles Lyding, Derek Cormier, Doug Parker, Dylan Hunn, George Kalpakas, Greg Magolan, Jessica Janiuk, JiaLiPassion, Joey Perrott, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Renan Ferro, Tim Gates, Vadim, Virginia Dooley, ced, mgechev, piyush132000, robertIsaac and sr5434
<!-- CHANGELOG SPLIT MARKER -->
<a name="15.0.4"></a>