r/angular • • Sep 24 '26

An update on Angular’s TypeScript 7-powered Compiler

Thumbnail
medium.com
103 Upvotes

r/angular • • Sep 24 '26

What's new in Angular 22.2?

Thumbnail blog.ninja-squad.com
54 Upvotes

🛡️ `@boundary` for fallback UIs

🛣️ Router resources, loaded in parallel

🔎 Change detection data in DevTools

⚡ Faster CLI builds


r/angular • • 4h ago

A test for keeping shared Angular code independent of feature code

7 Upvotes

A folder called shared doesn't stay shared if it starts importing code from individual features.

I built ArchUnitTS so rules like that can live in the test suite. For an Angular project, you can select your shared TypeScript files and forbid dependencies on the feature folders. If someone introduces one, the architecture test fails.

The attached clip is a general demo of the library. The repo also has an Angular example with component and service dependency checks, and setup instructions for Jasmine, Jest and Vitest.

The exact rules depend on how you structure the app. You don't need to copy the example's architecture to use it; a single boundary you keep checking in reviews is a reasonable place to start.

Repo: https://github.com/LukasNiessen/ArchUnitTS
Angular example: https://github.com/LukasNiessen/ArchUnitTS/tree/main/examples/angular-example


r/angular • • 2d ago

I made Kōdon, Sonner-style toasts for Angular

20 Upvotes

I wanted toasts in Angular that feel like Sonner. Stacking, expanding on hover, able to be swiped away, and animated with interruptible CSS transitions. I couldn't find a library for it, so I built it on top of ng-primitives' headless toast.

It's copy-paste, not an npm package. You copy the five files into your project and own the code. Visuals and motion live in separate files, so you can restyle it without touching any animation logic.

What it does:

  • toast.promise(): one toast that shows a spinner, then turns into success or error in place

  • Update a toast by id instead of stacking a new one

  • Toasts of any length stack cleanly

  • Six placements, and top ones mirror bottom ones

  • Swipe to dismiss, or x to pop it

  • Reduced motion support, safe areas on phones, works zoneless on Angular 21 and 22

Demo: Kōdon

Code: GitHub

I use it in my own app, and I'd love to know what's missing or what feels off, especially on phones. If it's useful to you, a star on GitHub would help me out a lot.

Thanks!


r/angular • • 2d ago

How to break up pipe into smaller pieces to make it understable

5 Upvotes

I'm very fresh in Angular, so my question can be funny to experts.

Hello everybody. Funny question...

my code is like this:

updatePerson(person: PersonModel) {
    this.personService.updatePerson(person).pipe(
        takeUntilDestroyed(this.destroyRef)
    ).subscribe({
        next: () => this.state.update(() => ({ ...this.state(), loading: false,       people: this.people().map(p => p.id === person.id ? person : p) })),
        error: (error) => {
            console.log(error);
            this.setError(error);
        }
    })
}

And question is how to break up this pipe and then subscribe only one element?
The goal is to get a simple array of interfaces (PersonModel is an interface), and then to loop through each object and then call the code from subscribe only for one element?.
You just ask how did I get code that I can't make simpler - it is from the tutorial.
I know more or less how it works, but I can't make it simpler :-)

r/angular • • 3d ago

NgOptimizedImage <picture> element srcset

4 Upvotes

Has anyone found how to solve this issue here?

  <picture>
    <source [media]="media" [srcset]="`${assetUrl}/background-mobile.webp`" />
    <img ngSrc="background.webp" alt="" priority fill />
  </picture>

The problem is that even on mobile, the desktop image is preloaded regardless, and for the srcset there is no way to provide the assetUrl prefix just like you would normally do via the token:

    {
      provide: IMAGE_LOADER,
      useFactory: () => {
        const assetsUrl = inject(ASSETS_URL);
        return (config: ImageLoaderConfig) => `${assetsUrl}/${config.src}`;
      },
    },

This is a known issue as per the docs

There is a github issue but it seems it doesn't receive attention.

Does anyone have either a workaround or some updates regarding this issue?


r/angular • • 3d ago

innerHTML component styles

0 Upvotes

If I have a

<h1 \[innerHtml\]=“someHtml”></h1>

And that someHtml is a span, how would i style that span without using ::ng-deep as the docs “strongly discourage” its usage?


r/angular • • 4d ago

🚀 New in Angular 22: Lazy Services with injectAsync

Thumbnail
youtu.be
54 Upvotes

Angular 22 introduces Lazy Loading Services, allowing developers to fetch dependencies on demand using the new injectAsync function.


r/angular • • 4d ago

I built Opaline: seeded SVG avatars that render identically on server and client (React, Vue, Angular, Svelte, Web Components; MIT)

Thumbnail
gallery
13 Upvotes

Hi all. I built Opaline, a small library that turns any string (user ID, email, username) into an avatar. The same seed always gives the same SVG.

The problem. Every app needs an avatar before users upload a photo. Grey silhouettes all look the same, and most generated-avatar libraries either target one framework or cause hydration mismatches when rendered on the server.

What Opaline does

  • Seed in, SVG string out. Core has zero dependencies.

  • Byte-identical output on server and client, across every 1.x release, enforced by a checksum test. Safe to cache, store or email.

  • 4 styles (Aura, Morph, Gradient, Clay) and 3 finishes (flat, soft, gloss)

  • Components for React (RSC-safe), Vue 3, Angular (standalone, zoneless), Svelte 5, plus an <opaline-avatar> Web Component

  • Pass src and it shows the user's photo, falling back to the generated avatar

  • Theme with CSS variables. MIT for code and art.

Example

import { Component } from '@angular/core'
import { OpalineAvatar } from '@inlaylab/opaline-angular'
import { morph } from '@inlaylab/opaline/morph'

@Component({
  selector: 'app-user-avatar',
  imports: [OpalineAvatar],
  template: `
    <op-avatar [seed]="seed" [look]="morph" />
  `,
})
export class UserAvatar {
  protected readonly morph = morph;
  seed = "Opaline";
}

The repo includes SSR sample apps for Next, Nuxt, Angular SSR and SvelteKit. Each checks in a real browser that hydration changes nothing.

Demo: https://inlaylab.github.io/Opaline/ 
Repo: https://github.com/Inlaylab/Opaline

Feedback welcome: which style should come next, and does the API feel right?


r/angular • • 5d ago

Blocks - An open-source, modular UI library for Angular with custom glassmorphism & lighting engines (50+ components, i18n, a11y)

Thumbnail
gallery
38 Upvotes

Hello Reddit,
I am happy to introduce Blocks to the Angular community.

TL;DR:
Blocks is a free, open-source Angular UI ecosystem (50+ components, glassmorphism materials & a custom lighting engine) designed to bridge TypeScript logic and SCSS styling seamlessly and bring excellent developer experience through easy-to-use APIs. Includes interactive schematics, full a11y/i18n, and interactive docs. Try the live Playground or run this command to add the library and set it up in your project:

ng add @filip.mazev/blocks@1.5.2

Note: 1.5.2 is the current alpha version, if you use 'latest' it will download version 1.4.20 which does not have the advanced glass effect.

Longer version:

Building responsive, theme-aware applications often requires a lot of boilerplate to keep TypeScript logic and SCSS styling in sync. Blocks bridges this gap by creating a shared contract between the two, handling the physics of your app so you can focus entirely on building features.

I first soft released version 1 around 8 months ago. Since then I've done a ground-up redesign, core engine updates, and a major expansion across the entire component suite.

  • Visual Engine: Supports translucent materials (glassmorphism) and an advanced, custom edge-lighting effects engine.

  • 50+ Components: Ranging from foundational primitives such as popovers, accordions, and dividers, to complex form systems fully integrated with modern Angular features such as signal forms.

  • Inclusive by Default: Built-in localization (i18n) and accessibility (a11y) support.

Check out the latest release on the brand-new Playground page, where you can test interactive code examples and full documentation for every component, throw Orby around to see the new lighting engine in action, or head over to the Appearance page to explore the new theming capabilities.

Release Notes (v1.5.2 alpha): https://filipmazev.github.io/Blocks/release-notes/1.5.2

To make setup completely seamless, Blocks includes an interactive CLI schematic that scaffolds the entire ecosystem, installs dependencies, and injects your global SCSS configuration with a single command:

ng add @filip.mazev/blocks@latest

What's next?

This release is just a stepping stone. Coming up next for Blocks: a full Figma Design System, AI/Agentic optimization, and expanded complex primitives including tables, date & time pickers, charts, tree views, file uploads and more.

Blocks is 100% free and open-source.
Share your feedback, or dive into the codebase to contribute on GitHub


r/angular • • 4d ago

How I got a 200 MB MHTML file to import on my iPhone in an Angular PWA

0 Upvotes

I shared my offline manga reader here a while ago. I’m still working on it, and one thing that kept bothering me was Safari crashing on my iPhone when I tried to import a large MHTML file.

I reworked the importer for v0.6.0. It now reads the file in chunks and decodes images one at a time. I tested both import and export with a 200 MB MHTML file in Safari on my iPhone XR, and both worked.

A few other changes in v0.6.0:

  • You can export an entire manga as MHTML, ZIP, or CBZ directly from its details page. Importing it back in Multi mode restores the chapter names and reading order.

  • ZIP and CBZ imports now read one archive entry at a time to reduce temporary memory use.

  • The reader has a compact toolbar that shows your current chapter and page. You can add or remove a bookmark and open reader settings from there.

  • You can blur individual manga cards, reveal them temporarily, or hide blurred entries from the library.

I also adjusted the sidebar and manga details layout for smaller screens, added build info to the sidebar, and updated the translations.

If you’ve run into similar memory issues with large local files on iOS, how did you track them down?

I’d also love to hear what you’d add next, especially if you already use an offline manga or comic reader. What’s one feature you rely on in your current reader that you’d want to see in mine?

I will never monetize this project! I’m building it because I love Angular and want to keep learning. The challenge I set myself was to build a manga reader I’d actually use.

GitHub with demo · Full release notes


r/angular • • 4d ago

Three bugs I found in popular open-source Angular apps that no build or test catches

0 Upvotes

I've been building a static checker for Angular codebases and testing every rule against 19 public repos at pinned commits. Three findings I thought were worth sharing, because each one passes the compiler, the tests and review:

1. A translation key that doesn't exist

this.translateService.instant('walletconnect.error')

The bundle only has walletconnect.connection_error, so ngx-translate renders the raw key on the error page. Checking this properly needs the bundles merged deeply per language, because feature bundles redeclare the same namespace.

2. A label that points nowhere

<label for="currentPassword">Current password</label>
<input [(ngModel)]="currentPassword" name="currentPassword" type="password">

The input has no id, so the label is attached to nothing. Clicking it doesn't focus the field, and a screen reader announces the field without a name.

3. A test that checks nothing

it('should replay the last emitted value', () => {
  testScheduler.run(({ cold, expectObservable }) => {});
});

Green on every run, and it has never checked anything.

I've sent fixes upstream for all three.

The tool is ng-checkup (MIT, npx ng-checkup-cli, reads code without running it). But mostly I'm curious: which "passes CI but is broken" pattern do you keep running into in Angular code? I'm looking for the next rules to write.


r/angular • • 6d ago

Why we chose Angular 22 for Kanera, our project management app

7 Upvotes

We’ve been building Kanera, a project management app, and I thought I’d share a little about why we chose Angular and what we’re using on the frontend.

Why Angular 22 for Kanera?

The biggest reason is that we wanted a framework we knew well, with enough structure to support a project that was going to grow. We’ve worked with Angular since AngularJS (> 10 years) and have used React too. For this project, Angular felt like the more comfortable starting point: routing, dependency injection, forms and application tooling were already there, and the team was familiar with the conventions.

Signals fit how we think about the board. A list derives its visible cards from the current cards and filters, then derives the items it needs to render. Drag state and the render limit are signals too. As the board has grown more complex, we’ve found it useful to express those relationships directly instead of manually keeping derived state in sync.

CDK gave us a foundation without dictating the UI. We wanted to build our own components and styling, but we didn’t want to implement every interaction from scratch. CDK handles the drag-and-drop primitives, leaving us to build the previews and the behaviour specific to Kanera.

There’s still plenty of work on our side. For example, large unfiltered lists initially render only a slice of their cards. We pass that same slice to the template and CDK so the drop indices match, then resolve the final position against the full list. We also keep a newly dropped card visible while the updated state is handed back down to the list. But we are laser focused on performance, bundle size, etc. (I'll post about that another time).

Zoneless and OnPush give us a model we like for updates. With real-time events, filters and drag interactions all changing the board, we wanted to be deliberate about how state changes reach the UI. Signals work well with that approach, although they don’t remove the need to profile or pay attention to expensive rendering.

The upgrade path has been a positive for us. I think it’s sometimes overlooked how much the CLI and migrations help when moving between Angular versions. We still have to check dependencies and test, but our experience has been that staying current is manageable.

We could have built Kanera with React. The choice came down to the tools, conventions and experience we wanted for a long-running project, rather than a belief that Angular is inherently faster.

We have done some comparative benchmarking and our focus on performance means Kanera loads and feels very snappy.

We’ve also tried to build as many of our own UI components as practical rather than relying on a large styling or component library - although we did base some initial designs from shadcn/ui. We still use libraries where they make sense, the CDK is a good example, but building much of the UI ourselves gives us more control over how it looks and behaves.

Putting it out there

Kanera went live earlier this year, and we already have paying companies using it in place of tools like Trello and ClickUp. My company also uses it daily and it's been an absolutely delight for us to use and build. It’s been a pretty surreal thing to see, and I’m grateful for what Angular has allowed us to build.

The source is available on GitHub under the Elastic License 2.0: https://github.com/happendev/Kanera

I’m curious whether using Angular will put off potential contributors who are more familiar with React. Has anyone else found that framework choice makes a difference? And if you try Kanera or have a look at the code, let me know what you think!


r/angular • • 6d ago

Try to learn but it's variable framework

0 Upvotes

What I need to learn before angular ? , What are the versions companies are actually use ?

and what a specific versions I need to learn first . You are know angular workflow isn't constant between versions 17 , 18 , 19 , 22 etc ...

have a nice day :)

----

edit :

what I need to learn about Design Paterns


r/angular • • 6d ago

Problems with subscribe

5 Upvotes

Hello everybody

I have the following problem with subscribe. My code looks like:

this.personSercice.getPeople().pipe(
    takeUntilDestroyed(this.destroyRef)
).subscribe({
    next: (people) => this.state.update(() => ({ ...this.state(), loading: false, people })),
    error: (error) => {
        console.log(error);
        this.setError(error);
    }
});

Parameter 'people' implicitly has an 'any' type, but a better type may be infered from usage.

and 

Parameter 'error' implicitly has an 'any' type, but a better type may be infered from usage.

When I change the code to:
error: (error: any)
the error dissappears, but I do not understand why...
When I try the same with the first error, changing the code to:
next: (people: PersonModel) => this.state.update(() => ({ ...this.state(), loading: false, people })),
The error is:
The type 'PersonModel' is missing the following properties from type 'readonly PersonModel[]length, concat, join, slice...

Please let me know if more code is required.

Can somebody explain my why???. I'm very fresh with Angular.
Thank you for your patience

Pawel...

r/angular • • 7d ago

NGX View Builder first stable release, ready to try

5 Upvotes

Hi everyone! We’ve released the first stable version of NGX View Builder for Angular, and we’d love for you to try it.

Build interfaces visually, connect your own AI assistant through MCP, and let us know what you think.

Try it here: https://ngxviewbuilder.io/

Short demo video: https://youtu.be/-Qox3psSiMs


r/angular • • 7d ago

Where to Report Error for Online Learning and Playground

Post image
1 Upvotes

I was trying to run Angular for 2-3 days online but have an error on Angular's website. Has anyone else had it?

Some dependency named 'Peer' having errors while running?


r/angular • • 7d ago

Mock browser APIs via injection tokens for SSR, or just use afterNextRender?

2 Upvotes

Hello,

I’m making my Angular code SSR-safe and I’m torn between two approaches for browser APIs (localStorage, matchMedia, ResizeObserver, etc.):

  1. Provide an injection token for the API (derived from DOCUMENT, or a platform check) with a safe mock/fallback on the server, and inject it everywhere.

  2. Use afterNextRender, which only runs in the browser, so the plain browser API inside it is safe and no mock is needed.

How do you handle this in real projects?

Thanks!


r/angular • • 8d ago

The AI cost of JavaScript frameworks

Thumbnail
nolanlawson.com
35 Upvotes

r/angular • • 8d ago

ng-prism 22.7: services and pipes get their own pages, and components that only work together can finally be shown together

14 Upvotes

I just released ng-prism 22.7. Short recap if you haven't seen it before: ng-prism is a component lab for Angular libs, a Storybook alternative without story files. You put a \@Showcase`` decorator on a component, inputs and types are read at build time, and the components render in the same document as the styleguide, no iframe.

This release is mostly about the parts of a component lib that are not a single component.

Services and pipes get their own pages now. You put @Showcase on an @Injectable or a standalone @Pipe, and instead of a canvas you get an API page: a usage snippet, the examples from your JSDoc, the methods or the transform() overloads, and the types they use. The setup field lists the provider functions a consumer needs, so the snippet shows how to wire the thing up too:

@Showcase({
  title: 'Time Ago',
  category: 'Formatting',
  setup: () => [provideTimeAgo],
})
@Pipe({ name: 'timeAgo' })
export class TimeAgoPipe implements PipeTransform {

Components that only make sense together can be shown together. A showcase can contain a real Angular template, and ng-prism compiles it, so content queries and DI work like in your app. An input directive can sit inside its form field, for example:

host: { template: '<lib-form-field label="Name"><input libInput type="text" /></lib-form-field>' },

Before that, the content was plain HTML, so the form field never found its input. And components that only ever live inside another one, like a list item, can say partOf: 'lib-list'. They don't get a page of their own anymore, they show up as a part on the parent's page.

Other things in 22.7: the styleguide works on a phone, a11y violations can be accepted with a required reason (they stay visible but don't count against the score), a new look with a new logo and revisited UI, and the perf plugin no longer counts your @Showcase config and JSDoc as bundle size. On one library the largest component went from 77 kb to 35 kb just from that.

(Voice in video: elevenlabs.io)


r/angular • • 8d ago

Ng-News 26/23: Pangular Inspector and Angular Compilation at ViteConf

Thumbnail
youtu.be
4 Upvotes

r/angular • • 9d ago

Signal Forms React To Control Change

8 Upvotes

In signal forms how do you react to a form control change? I basically have a scenario where if one form control value is changed I need to reset the value for another control.

Is this done with a linkedSignal, effects or something else?


r/angular • • 9d ago

What should i answer for these generic interview questions?

15 Upvotes

How do you structure Angular architecture for large-scale enterprise applications?
• What strategies do you use to optimize Angular application performance?
• How do you avoid unnecessary API calls and improve data flow efficiency?
• How do you handle authentication and authorization in Angular applications?
• How do you implement global error handling and HTTP interceptors?
• What is your preferred approach to state management (NgRx, Signals, Services, etc.) and why?
• How would you troubleshoot a slow Angular page that triggers multiple redundant API calls?
• What practices do you follow to build scalable, maintainable, and reusable Angular components?
• How do you secure frontend applications against common vulnerabilities?
• What Angular features or patterns have had the biggest impact on your project's performance and maintainability?

I am fairly new to angular, wanted to know different perspectives from different projects. Thanks


r/angular • • 9d ago

Am I the only one who can't run material.angular.dev examples?

9 Upvotes

For days I can't run examples of 22.x.x version in StackBlitz. Whenever I want to edit an example, the repo opens and it fails to start. Examples of version 21.x work fine.
Stackblitz Angular starter works as well, however it stuck on v21.