Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@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.
License: MIT
14.2.0 (2022-08-25)
| Commit | Type | Description | | -- | -- | -- | | b96e571897 | fix | fix stagger timing not handling params (#47208) |
| Commit | Type | Description |
| -- | -- | -- |
| b380fdd59e | feat | add a density cap for image srcsets (#47082) |
| 7ce497e5bc | feat | add built-in Imgix loader (#47082) |
| bff870db61 | feat | add cloudflare loader (#47082) |
| 86e77a5d55 | feat | add Image directive skeleton (#45627) (#47082) |
| 0566205a02 | feat | Add image lazy loading and fetchpriority (#47082) |
| 4e952ba216 | feat | add loaders for cloudinary & imagekit (#47082) |
| e854a8cdde | feat | add loading attr to NgOptimizedImage (#47082) |
| 8d3701cb4c | feat | add warnings re: image distortion (#47082) |
| d5f7da2120 | feat | define public API surface for NgOptimizedImage directive (#47082) |
| d3c3426aa4 | feat | detect LCP images in NgOptimizedImage
and assert if priority
is set (#47082) |
| 451b85ca17 | feat | explain why width/height is required (#47082) |
| 586274fe65 | feat | provide an ability to exclude origins from preconnect checks in NgOptimizedImage (#47082) |
| 57f3386e5b | feat | support custom srcset attributes in NgOptimizedImage (#47082) |
| 7baf9a46cd | feat | verify that priority images have preconnect links (#47082) |
| f81765b333 | feat | warn if rendered size is much smaller than intrinsic (#47082) |
| e2ab99b95e | fix | allow null/undefined to be passed to ngClass input (#39280) (#46906) |
| bedf537951 | fix | allow null/undefined to be passed to ngStyle input (#47069) |
| f9511bf6e8 | fix | avoid interacting with a destroyed injector (#47243) |
| dc29e21b14 | fix | consider density descriptors with multiple digits as valid (#47230) |
| 801daf82d1 | fix | detect data:
and blob:
inputs in NgOptimizedImage
directive (#47082) |
| fff8056e7f | fix | fix formatting on oversized image error (#47188) (#47232) |
| 1ca2ce19ab | fix | remove default for image width (#47082) |
| c5db867ddc | fix | remove duplicate deepForEach (#47189) |
| 1cf43deb18 | fix | sanitize rawSrc
and rawSrcset
values in NgOptimizedImage directive (#47082) |
| d71dfe931f | fix | set bound width and height onto host element (#47082) |
| 32caa8b669 | fix | support density descriptors with 2+ decimals (#47197) (#47232) |
| ae4405f0bf | fix | throw if srcset is used with rawSrc (#47082) |
| 0c8eb8bc82 | perf | monitor LCP only for images without priority
attribute (#47082) |
| Commit | Type | Description |
| -- | -- | -- |
| ea89677c12 | feat | support more recent version of tsickle
(#47018) |
| Commit | Type | Description |
| -- | -- | -- |
| d1e83e1b30 | feat | add createComponent
function (#46685) |
| 10becab70e | feat | add reflectComponentType
function (#46685) |
| 4b377d3a6d | feat | introduce createApplication API (#46475) |
| 31429eaccc | feat | support TypeScript 4.8 (#47038) |
| 796840209c | fix | align TestBed interfaces and implementation (#46635) |
| Commit | Type | Description |
| -- | -- | -- |
| 426af91a42 | feat | add FormBuilder.record()
method (#46485) |
| b302797de4 | fix | Correctly infer FormBuilder
types involving [value, validators]
shorthand in more cases. (#47034) |
| Commit | Type | Description | | -- | -- | -- | | 598b72bd05 | feat | support fix the component missing member (#46764) |
| Commit | Type | Description |
| -- | -- | -- |
| 07606e3181 | feat | add isEmpty
method to the TransferState
class (#46915) |
| Commit | Type | Description | | -- | -- | -- | | 2b4d7f6733 | feat | support document reference in render functions (#47032) |
| Commit | Type | Description |
| -- | -- | -- |
| 0abb67af59 | feat | allow guards and resolvers to be plain functions (#46684) |
| 75df404467 | feat | Create APIs for using Router without RouterModule (#47010) |
| 10289f1f6e | feat | expose resolved route title (#46826) |
| 8600732b09 | feat | Expose the default matcher for Routes
used by the Router
(#46913) |
| 422323cee0 | feat | improve typings for RouterLink boolean inputs (#47101) |
| 26ea97688c | feat | Make router directives standalone (#46758) |
| 2a43beec15 | fix | Fix route recognition behavior with some versions of rxjs (#47098) |
| Commit | Type | Description |
| -- | -- | -- |
| 383090858c | feat | support sendRequest
as a notificationclick
action (#46912) |
| 3f548610dd | fix | export NoNewVersionDetectedEvent (#47044) |
| 482b6119c2 | fix | update golden index.md
(#47044) |
Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Bob Watson, Cédric Exbrayat, Dylan Hunn, Emmanuel Roux, FatalMerlin, George Kalpakas, Ilia Mirkin, Jan Kuehle, Jeremy Elbourn, Jessica Janiuk, JiaLiPassion, Kalbarczyk, Kara Erickson, Katie Hempenius, Kristiyan Kostadinov, Merlin, Paul Gschwendtner, Pawel Kozlowski, Tristan Sprößer, Victor Porof, angular-robot[bot], dario-piotrowicz, ivanwonder and vyom
<!-- CHANGELOG SPLIT MARKER --><a name="14.1.3"></a>
FAQs
Angular - library for using Angular in a web browser
The npm package @angular/platform-browser receives a total of 2,425,507 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.