
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
@angular/compiler
Advanced tools
The @angular/compiler package is a core part of the Angular framework that is responsible for compiling Angular templates into JavaScript code that can be executed by the browser. It takes the templates and annotations provided in Angular components and generates code that represents the structure and behavior of the application.
Template Compilation
This feature allows you to compile Angular components and modules dynamically at runtime. The code sample demonstrates how to use the JIT compiler to compile a module and its components asynchronously.
import { Compiler, COMPILER_OPTIONS, CompilerFactory } from '@angular/core';
import { JitCompilerFactory } from '@angular/platform-browser-dynamic';
// Get a reference to the JIT compiler factory
const compilerFactory: CompilerFactory = platformBrowserDynamic().injector.get(CompilerFactory);
const compiler = compilerFactory.createCompiler();
// Compile a component dynamically
compiler.compileModuleAndAllComponentsAsync(DynamicModule)
.then(compiled => {
const moduleRef = compiled.ngModuleFactory.create(this.injector);
const componentFactory = compiled.componentFactories[0];
this.container.createComponent(componentFactory);
});
AOT Compilation
Ahead-of-Time (AOT) compilation converts Angular HTML and TypeScript code into efficient JavaScript code during the build process, before the browser downloads and runs the code. This code sample shows how to bootstrap an Angular application using the AOT-compiled module factory.
import { enableProdMode } from '@angular/core';
import { platformBrowser } from '@angular/platform-browser';
import { AppModuleNgFactory } from './app/app.module.ngfactory';
enableProdMode();
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
Babel is a JavaScript compiler that converts ECMAScript 2015+ code into a backwards-compatible version of JavaScript that can be run by older JavaScript engines. Babel is similar to @angular/compiler in that it performs code transformation, but it is not specific to Angular and does not compile Angular templates.
TypeScript is a superset of JavaScript that compiles to plain JavaScript. It is similar to @angular/compiler in that it performs a compilation step, but TypeScript focuses on type-checking and converting TypeScript code to JavaScript, rather than compiling framework-specific templates.
The vue-template-compiler package is used to compile Vue.js templates into render functions. It is similar to @angular/compiler as both are used for compiling framework-specific templates, but they target different frameworks (Vue.js vs 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
20.2.0-next.1 (2025-07-16)
| Commit | Type | Description | | -- | -- | -- | | a1e3f2bcd1 | fix | incorrect spans for left side of binary operation (#62641) | | 18a675081f | fix | more permissive parsing of @ characters (#62644) |
| Commit | Type | Description | | -- | -- | -- | | 527bd778a7 | fix | infer type of event target for void elements (#62648) |
| Commit | Type | Description | | -- | -- | -- | | 745ea44394 | feat | support TypeScript 5.9 (#62541) | | 859958dbfe | fix | Ensure application remains unstable during bootstrap (#62631) | | 780774f948 | fix | InputBinding marks component a dirty. (#62613) |
| Commit | Type | Description |
| -- | -- | -- |
| be811fee79 | feat | add referrer & integrity support for fetch requests in httpResource (#62461) |
| 1408baff45 | fix | Add missing timeout and transferCache options to HttpClient
(#62586) |
| 75a5d08c5e | fix | do not display warnings Angular detected that a
HttpClientrequest with the
keepalive option was sent using XHR
when option is not true (#62536) |
| Commit | Type | Description | | -- | -- | -- | | d64dd27a02 | feat | support to report the deprecated API in the template (#62054) |
| Commit | Type | Description | | -- | -- | -- | | 9c45c322d1 | fix | ensure preloaded components are properly activated (#62502) | | e9f215624f | fix | handle errors from view transition readiness (#62535) |
<!-- CHANGELOG SPLIT MARKER --><a name="20.1.1"></a>
FAQs
Angular - the compiler library
The npm package @angular/compiler receives a total of 3,118,802 weekly downloads. As such, @angular/compiler popularity was classified as popular.
We found that @angular/compiler 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
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.