Socket
Socket
Sign inDemoInstall

@angular/platform-browser

Package Overview
Dependencies
6
Maintainers
2
Versions
800
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
Weekly downloads
2.8M
increased by0.29%
Maintainers
2
Install size
821 kB
Created
Weekly downloads
 

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

17.0.5 (2023-11-29)

core

| Commit | Type | Description | | -- | -- | -- | | 6be88040d1 | fix | avoid stale provider info when TestBed.overrideProvider is used (#52918) | | dee50f1d78 | fix | inherit host directives (#52992) | | 07920d96d4 | fix | Reattached views that are dirty from a signal update should refresh (#53001) |

migrations

| Commit | Type | Description | | -- | -- | -- | | aab7fb8654 | fix | Add ngForTemplate support to control flow migration (#53076) | | dbd6f386ea | fix | allows colons in ngIf else cases to migrate (#53076) | | 5b9f896009 | fix | cf migration fix migrating empty switch default (#53237) | | 2b3d3b0fe1 | fix | CF migration log warning when collection aliasing detected in @for (#53238) | | dffeac8386 | fix | cf migration removes unnecessary bound ngifelse attribute (#53236) | | 00cb3339ba | fix | control flow migration formatting fixes (#53076) | | c22af72f75 | fix | fix off by one issue with template removal in CF migration (#53255) | | ba6d7fe018 | fix | fixes CF migration i18n ng-template offsets (#53212) | | 8f6affdd64 | fix | fixes control flow migration common module removal (#53076) | | 6ae408847c | fix | properly handle ngIfThen cases in CF migration (#53256) | | 0fcef65cea | fix | Update CF migration to skip templates with duplicate ng-template names (#53204) |

router

| Commit | Type | Description | | -- | -- | -- | | 91486aaf07 | fix | Resolvers in different parts of the route tree should be able to execute together (#52934) |

<!-- CHANGELOG SPLIT MARKER -->

<a name="17.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 29 Nov 2023

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc