Socket
Socket
Sign inDemoInstall

@angular/platform-browser

Package Overview
Dependencies
6
Maintainers
0
Versions
809
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @angular/platform-browser

Angular - library for using Angular in a web browser


Version published
Maintainers
0
Created

Package description

What is @angular/platform-browser?

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.

What are @angular/platform-browser's main functionalities?

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');
  }
}

Other packages similar to @angular/platform-browser

Changelog

Source

18.1.0-next.3 (2024-06-20)

compiler-cli

| Commit | Type | Description | | -- | -- | -- | | 0b867e83b6 | fix | insert constant statements after the first group of imports (#56431) |

core

| Commit | Type | Description | | -- | -- | -- | | 5df3e78c99 | feat | add equality function to rxjs-interop toSignal (#56447) | | 352e0782ec | feat | expose signal input metadata in ComponentMirror (#56402) | | bf6df6f186 | fix | do not activate event replay when no events are registered (#56509) | | 86bcfd3e49 | fix | improve docs on afterRender hooks (#56522) | | 03a2acd2a3 | fix | properly remove imports in the afterRender phase migration (#56524) |

forms

| Commit | Type | Description | | -- | -- | -- | | 00bde8b1c2 | fix | Make NgControlStatus host bindings OnPush compatible (#55720) |

language-service

| Commit | Type | Description | | -- | -- | -- | | 67b2c336bc | fix | import the default exported component correctly (#56432) |

router

| Commit | Type | Description | | -- | -- | -- | | 1d3a7529b4 | feat | Set a different browser URL from the one for route matching (#53318) | | 0d52c6b182 | fix | Delay the view transition to ensure renders in microtasks complete (#56494) |

<!-- CHANGELOG SPLIT MARKER -->

<a name="18.0.4"></a>

Readme

Source

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

FAQs

Last updated on 20 Jun 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc