Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@angular/platform-browser
Advanced tools
The @angular/platform-browser package provides services that are essential for running Angular applications in a web browser. This includes DOM manipulation, rendering, and browser interaction APIs.
DOM Manipulation
The BrowserModule provides services that are necessary for any web app, such as DOM rendering, sanitization, and location. It should be imported once in the root module of the app.
import { BrowserModule } from '@angular/platform-browser';
@NgModule({
imports: [BrowserModule],
...
})
export class AppModule { }
Browser Event Handling
The package allows components to handle browser events such as resize, keyup, and more through the HostListener decorator.
import { Component, HostListener } from '@angular/core';
@Component({...})
export class MyComponent {
@HostListener('window:resize', ['$event'])
onResize(event) {
// Handle the browser resize event
}
}
Safe Interpolation
The DomSanitizer service helps prevent Cross Site Scripting Security bugs (XSS) by sanitizing values to be safe to use in the different DOM contexts.
import { DomSanitizer } from '@angular/platform-browser';
@Component({...})
export class MyComponent {
safeUrl;
constructor(private sanitizer: DomSanitizer) {
this.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl('https://example.com');
}
}
Similar to @angular/platform-browser for Angular, react-dom is used with React to interact with the DOM. It provides methods for rendering components into the DOM and working with the DOM elements.
Vue is a progressive framework for building user interfaces. It provides its own methods for DOM manipulation and updates, similar to what @angular/platform-browser does for Angular applications.
Preact is a fast 3kB alternative to React with the same modern API. It provides similar functionalities for rendering and handling the DOM as @angular/platform-browser does for Angular.
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT
19.1.0 (2025-01-15)
| Commit | Type | Description | | -- | -- | -- | | e4c50b3bea | feat | expose component instance in NgComponentOutlet (#58698) |
| Commit | Type | Description | | -- | -- | -- | | ceadd28ea1 | fix | allow $any in two-way bindings (#59362) | | aed49ddaaa | fix | use chunk origin in template HMR request URL (#59459) |
| Commit | Type | Description | | -- | -- | -- | | c5c20e9d86 | fix | check event side of two-way bindings (#59002) |
| Commit | Type | Description | | -- | -- | -- | | d010e11b73 | feat | add event listener options to renderer (#59092) | | 57f3550219 | feat | add utility for resolving defer block information to ng global (#59184) | | 22f191f763 | feat | extend the set of profiler events (#59183) | | e894a5daea | feat | set kind field on template and effect nodes (#58865) | | bd1f1294ae | feat | support TypeScript 5.7 (#58609) | | 9870b643bf | fix | Defer afterRender until after first CD (#58250) | | a5fc962094 | fix | Don't run effects in check no changes pass (#58250) |
| Commit | Type | Description | | -- | -- | -- | | d298d25426 | feat | add schematic to clean up unused imports (#59353) | | 14fb8ce4c0 | fix | resolve text replacement issue (#59452) |
| Commit | Type | Description | | -- | -- | -- | | 8c5db3cfb7 | fix | avoid circular DI error in async renderer (#59256) |
| Commit | Type | Description |
| -- | -- | -- |
| 52a6710f54 | fix | complete router events
on dispose (#59327) |
<a name="19.0.7"></a>
FAQs
Angular - library for using Angular in a web browser
The npm package @angular/platform-browser receives a total of 2,524,746 weekly downloads. As such, @angular/platform-browser popularity was classified as popular.
We found that @angular/platform-browser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.