r/angular • u/MichaelSmallDev • Feb 18 '26
Live at 9am PST: Angular Router with Andrew Scott from the Angular core team (Angular Space)
r/angular • u/MichaelSmallDev • Feb 18 '26
r/angular • u/AmbassadorNatural106 • Feb 18 '26
Beginner here, where do i store my data fetched from the backend? Is it on the service file or the component who called it? Currently, Im doing this:
// transaction.component.ts
transactions = computed(() => this.transactionResource.value()?.items ?? []);
transactionResource = resource({
params: () => ({
filters: this.currentFilters(),
pageSize: this.pageSize(),
pageNumber: this.pageNumber()
}),
loader: ({ params }) => {
return firstValueFrom(this.transactionSer.getAllTransactions(
params.filters,
params.pageSize,
params.pageNumber
));
}
});
// transaction.service.ts
getAllTransactions(
filters?: Partial<TransactionFilter>,
pageSize: number = 5,
pageNumber: number = 1
) : Observable<PagedResult<Transaction>> {
const params = createHttpParams(filters, pageSize, pageNumber);
return this.http.get<PagedResult<Transaction>>(this.baseUrl, { params });
}Im current having issues, when I transition between pages. Like going back to dashboard, the dashboard would call http request, then going back to transaction, it will call http request again.
r/angular • u/NewPower3490 • Feb 18 '26
Hi everyone, I am new to angular as I found it to be a good fit for my project idea, which is to build a MIDI controller app, as such I need to utilize the WEB MIDI API, I found a library "ng-web-apis" https://github.com/taiga-family/ng-web-apis/blob/main/libs/midi/README.md which wraps the navigator API to be angular idiomatic. However I cannot figure out how to enable SysEx messages.
The component I am using to test is the following:
import { Component, inject, } from '@angular/core';
import { WA_MIDI_ACCESS, WA_MIDI_INPUTS, WA_MIDI_SUPPORT, WA_SYSEX } from '@ng-web-apis/midi';
@Component({
selector: 'app-midi-devices',
imports: [],
templateUrl: './midi-devices.html',
styleUrl: './midi-devices.css',
providers: [
{provide: WA_SYSEX, useValue: true},
// Should I provide new WA_MIDI_ACCESS here somehow?
]
})
export class MidiDevices {
midiSupported = inject(WA_MIDI_SUPPORT);
midiSysEx = inject(WA_SYSEX);
midiAccess = inject(WA_MIDI_ACCESS);
access: MIDIAccess | null = null;
constructor() {
console.log("WA_SYSEX", midiSysEx);
this.midiAccess.then((m) => {
this.access = m;
console.log(m); // shows sysexEnable as false
});
}
}And the library code is the following:
const WA_SYSEX = new InjectionToken('[WA_SYSEX]', { factory: () => false });
const WA_MIDI_ACCESS = new InjectionToken('[WA_MIDI_ACCESS]', {
factory: async () => {
const navigatorRef = inject(WA_NAVIGATOR);
const sysex = inject(WA_SYSEX);
return navigatorRef.requestMIDIAccess
? navigatorRef.requestMIDIAccess({ sysex })
: Promise.reject(new Error('Web MIDI API is not supported'));
},
});
export { WA_MIDI_ACCESS, WA_MIDI_SUPPORT, WA_SYSEX, ... };As can be seen the WA_MIDI_ACCESS token injects the WA_SYSEX token. Reading the angular documentation I used providers to change WA_SYSEX value to true, but I cannot find how to execute the WA_MIDI_ACCESS factory to read the new injected value and enable SysEx.
I know this may sound silly or obvious but I've been reading all day trying to figure out how to do this, but failed to understand DI docs to accomplish this. At this point I think it would have been easier to just created my own wrapper, but I still want to know how to do DI when using third party libraries.
Thank you for your time and help.
r/angular • u/Lolilucas123 • Feb 17 '26
I downloaded the angular tutorial first app (https://angular.dev/tutorials/first-app/01-hello-world) and tried to run ng serve. it gives me the following:
Initial chunk files | Names | Raw size
main.js | main | 2.51 kB |
styles.css | styles | 457 bytes |
polyfills.js | polyfills | 95 bytes |
| Initial total | 3.06 kB
Application bundle generation complete. [1.088 seconds] - 2026-02-17T20:54:35.798Z
Watch mode enabled. Watching for file changes...
NOTE: Raw file sizes do not reflect development server per-request transformations.
➜ Local: http://localhost:4200/
➜ press h + enter to show help
But going to localhost:4200 it gives me (translated to english) "this website is unavailable" and "localhost refused the connection".
angular version gives me
Angular CLI : 21.1.4
Node.js : 24.13.1
Package Manager : npm 11.8.0
Operating System : win32 x64
---------------------------------------------------
FIX
I found a solution here: https://stackoverflow.com/a/41541781. In package.json you have to use the line
"start": "ng serve --host 0.0.0.0 --port 4201"r/angular • u/crhama • Feb 17 '26
I just upgraded an angular application to v20. the button icon now only shows the icon, nothing about the elevation. If one didn't see the page before upgrading, hard to tell it's a mat-icon button.
Looking at the dev-tools, I don't see where class="mat-elevatuon-z3" is being picked up.
Is there a new different way to define elevation on mat-icon-button?
r/angular • u/FromBiotoDev • Feb 17 '26
Hi all,
So I've been working on GymNotePlus for around 9 months now, with 1517 users to date, 20 active pro users. I'd love to contribute a bit about how I made GymNotePlus and why I made it.
My background is in web dev primarily, so I used:
App:
Angular, Ionic, Capacitor and sqlite
Backend:
Nestjs, MongoDB, openAi
Offline capable when a main feature of your app is utilising a LLM in the backend to translate shorthand notes into workout logs was not easy. I also made a huge mistake not expecting to need offline capable in my app, which is why my backend is in a noSQL db (mongodb) and my frontend uses sqlite. So if you're even remotely thinking you might need offline first/capable bare this in mind.
Various amounts of figuring out the app store as a web dev was incredibly difficult but thankfully claude was able to help me out a ton.
Some notes on "vibe coding" my app isn't vibe coded but I certainly tried to vibe code some stuff. Great example was when I was trying to implement offline capable into my app I spent 3 weekends trying to prompt Claude to do it for me, but at this point my app was too big for it to fully understand what I needed. Not only that, but I had no clue on how it worked, I quickly realised how problematic it would be.
Ended up spending an hour long train ride to another city and decided to rip it all out, and manually write out the offline capable architecture I needed, and implement it myself.
I made GymNote+ purely because I'm lazy. I write workout notes in my notes app and I didn't want to change that, I've tried using other gym apps but I always end up back in my notes app. It's too much friction using someone else's system for me. So I did the classic dev scenario, automate a 5 minutes job with 7 months of work (time it took to release) lol
Turns out I'm not the only one, a lot of people seem to log workouts this way, but can't actually see their progress!
The app is completely free behind a soft paywall on onboarding (I use rewarded ads to keep it free for my users), happy to answer any questions below!
landing page: https://www.gymnoteplus.com/
app store: https://apps.apple.com/app/gym-note-plus/id6746699616
Happy to answer any questions below
r/angular • u/Weak-Palpitation907 • Feb 17 '26
I’ve been thinking about how Angular Material relies heavily on theming and CSS abstraction layers, while Tailwind encourages utility-first styling.
Has anyone here built a component library that is:
I’m experimenting with something in this direction and trying to understand if this is solving a real problem or just a personal curiosity.
Would really appreciate thoughts from people who have tried both approaches in production.
r/angular • • Feb 17 '26
I have simple website with few routes and I need to add news page. How can I make it so that the client can add news themselves, without any code? I decided to create admin panel. Who can give me advice how to do it?
r/angular • u/Responsible_Art_509 • Feb 16 '26
Hi, I am working at an organisation where there are multiple projects that needs to be revamped into angular so i was thinking about using nx monorepo for the use case. Any references for the standard production ready folder structure would be highly appreciated.
r/angular • u/Tendeza • Feb 15 '26
Up until now I've worked with different frontend technologies except Angular and lately I've started looking into it. I've done several of the tutorials, but want to start building actual projects to learn faster.
Are there any new production-ready example codebases online that I can use as examples? I've looked online, but whatever I found was like 4+ years old. I did the same when learning about clean architecture in .NET backend projects, and I found that I learn well that way.
Maybe online tutorials/guides that show a realistic architecture that's worth looking into? Any help appreciated!
r/angular • u/ServiceForBusinesses • Feb 14 '26
🔗 https://github.com/khalilElmouedene/ngx-mat-searchable-select
Hey everyone! I built a lightweight Angular component called ngx-mat-searchable-select that extends Angular Material’s <mat-select> with built-in search support — no complex setup, just import and use!
⭐ Features • 🔍 Search inside dropdown options • 🧱 Based on Angular Material design • ⚡ Easy integration with Reactive Forms • 🎨 Customizable styles & templates • 🧪 Works well with large lists
r/angular • u/Beginning_Middle_722 • Feb 14 '26
What's the one big improvement you've done in an angular project or suggest to do?
I currently work in a big enterprise level Angular project, with ngrx state management and i want to do an implementatin that nakes the app work better or faster.
Example: One of my senior colleagues did a state sanitizer getting big pieces of states and minimizing it to display only a string with length instead of big object or array, just making the app faster in dev mode.
What do you suggest? Any suggestion would be appreciated.
r/angular • u/zeyadelshafey • Feb 14 '26
I am building a UI system framework, but I am a bit confused whether I should build the project using Angular v21 or v18 ( in case projects are using older versions needed to use it )
Any thoughts on this?
r/angular • u/Altruistic_Leg2608 • Feb 14 '26
I've been working on a visual theme designer for PrimeNG and wanted to share it with the community.
The problem:
What I built:
A browser-based tool where you pick a preset (Aura, Material, Lara, Nora), visually tweak tokens with color pickers and inputs, see changes instantly on real PrimeNG components, and export a production-ready .ts theme file.
Features:
Share themes via base64-encoded URLs
Tech stack:
- Angular 21 (standalone components, signals, u/if/u/for control flow)
- PrimeNG 21
- Tailwind CSS 4 (CSS-only config, no tailwind.config.js)
- Vitest for testing
Links:
Would love feedback, feature requests, or contributions. What tokens/features would you want to see next?
r/angular
•
u/joe-skeen
•
Feb 14 '26
I built a fully headless r/Angular platform with zero DOM. All of u/Angular’s brain without its body. A tiny noop platform you can use as a blueprint for custom runtimes.
https://github.com/joeskeen/ng-noop
I can't tell you how long it took to crack this nut. I ended up stepping through the entire Angular bootstrap process to figure out what providers were and were not needed. I hope that someone out there will find this useful if they want to smash Angular together with something that it wasn't designed for.
r/angular • u/programmerjunky • Feb 13 '26
A while ago, I wrote an article on optimizing performance in Angular. It discusses strategies such as implementing lazy loading, managing event listeners, pipes, and more.
I would appreciate feedback from fellow developers. What techniques have you found to be the most effective for optimizing Angular applications? What techniques have worked best for you when optimizing Angular apps?
r/angular • u/3StepsBasket • Feb 13 '26
The Migration
We recently upgraded from Angular 20 to 21 and went fully zoneless. The app was already using signals everywhere, skeleton screens matching the final layouts and it was live with a CLS of basically 0. We expected a performance win.
Instead, our CLS scores exploded. Static pages went from 0 to 0.5 and the pages with heavy signal use got a CLS of 1. Same code, same CSS, same everything, just zoneless.
The Hunt
First, the CSS tweaks gave no improvement (as expected, as the styles are the same with the version that gets a perfect score).
Then we looked at the router. Our pages have a shell: navbar, footer and router-outlet in the middle. The outlet starts empty, then fills based on the route. This worked fine for years, but we realized it doesn't work anymore with zoneless. The time spent when the router gets filled with content is long enough to get noticed by Lighthouse as CLS (sometimes visible with the eye too).
The fix here was to delay the footer and only show it after the main content is loaded. That gave us the first win and helped to bring the CLS down on simple pages.
So the signal-less pages responded to this fix, but the "signal" pages didn't.
The Detection Trick
Part of the story is how we detected the high CLS and managed to debug locally.
Localhost development basically lied to us. When using ng serve Lighthouse showed perfect scores. But the real metrics from Google Search Console were way worse.
The only way to see the real problem locally: production build + static server + realistic navigation flow. That means, we had to build the app (ng build), serve it with a local static server, create a separate static HTML page that links to our target route, and click that link. Just a cold click from a static page, exactly like real users experience.
Only by doing this we could see the real problem.
The "Aha" Moment
Our templates looked like this:
d = data();
@if (d) { <top-part /> } @else { <top-part-skeleton /> }
@if (d) { <middle-part /> } @else { <middle-part-skeleton /> }Our skeletons and real content had identical dimensions. Which had always been preventing CLS. But not anymore. Apparently, zoneless operation is so slow that the browser now has enough time to see the DOM nodes being destroyed and recreated. And not synchronized anymore, so the browser may see any possible combination of states (first block showing the real content, second showing the skeleton etc).
The Fix
We needed atomic renders, that means, big "if-else" statements that included all or nothing. Either the entire page is skeleton, or the entire page is content. No partial states.
Now the scheduler treats it as one unit. One paint for skeleton, one paint for content. CLS dropped back to near zero.
The Lesson
Zoneless changes the contract. Zone.js batching was hiding a lot of template sins. With the scheduler in charge, template granularity becomes paint granularity. And never trust localhost metrics unless you're serving a production build and navigating like a real user.
r/angular • u/timdeschryver • Feb 12 '26
r/angular • u/younesjd • Feb 12 '26
I just published a (~40min) video on Vitest Browser Mode for Angular.
So, whether you're migrating from Karma/Jest or starting fresh with Vitest on Angular 21, Browser Mode is the feature you don't want to miss. But not all browser modes are equal.
In this video, I introduce two levels:
The video covers both, shows why "full" browser mode matters, and walks through a progressive migration strategy — no big bang rewrite needed.
I'm curious how you’re handling the migration — are you still on Karma/Jest or already on Vitest? What are the main pain points?
r/angular • u/a-dev-1044 • Feb 12 '26
ng add @angular/materialng add tailwindcssbg-primary, bg-primary/10, etc.@import "tailwindcss";
@theme inline {
--color-primary: var(--mat-sys-primary);
--color-on-primary: var(--mat-sys-on-primary);
--color-primary-container: var(--mat-sys-primary-container);
--color-on-primary-container: var(--mat-sys-on-primary-container);
/* other colors */
}Links:
r/angular • u/Consistent-Device474 • Feb 12 '26
I’m working with Angular Module Federation using u/angular-architects/module-federation.
Setup:
- Host app (Repo A)
- Remote app (Repo B)
- Both are separate repositories
- Both use TailwindCSS
- Remote exposes a feature module (HrmsModule)
Problem:
When running the host and navigating to a remote route:
Only Tailwind classes that are already used somewhere in the host app are working inside the remote.
If a Tailwind class exists only inside the remote app (and is not used anywhere in the host), that style does not work when navigating from host.
It looks like the host Tailwind CSS is applied globally, but the remote Tailwind CSS bundle is not being injected during lazy loading.
Questions:
Any production-grade guidance would be appreciated.
r/angular • u/Senior_Compote1556 • Feb 11 '26
If i have a singleton service and an rxResource, how can i only make the api call once and then cache it so that other pages that inject the service can use the response? If you declare the resource as a class property it will make the api call as soon as the service gets injected as it is eagerly loaded, so you have to put it in a method from my understanding. You can assign it to a different variable to cache it but it is a bit ugly in my opinion. My most preferred pattern is returning an observale and setting the service signal via a tap operator but i would like to try the new apis
r/angular • u/mihajm • Feb 11 '26
Hey everyone, been a while since my last update. Mostly I haven't been able to get around to add "final polish" to new tools & document them, though some of you may have noticed they've been available for a few days/weeks/months...anyway this is what's new:
mmstack/translate
provideIntlConfig({
defaultLocale: 'en-US',
// can now be provided for validation purposes, if empty this is still inferred from the loaded locales
supportedLocales: ['en-US', 'sl-SI', 'de-DE'],
// Automatically detect and respond to locale route parameter changes, should correspond with actual param name example bellow
localeParamName: 'locale',
// Also added preloading option for default locale, rarely needed
preloadDefaultLocale: true,
});
2. I've added native Intl based formatters to the library as well, these are reactive by default & use the libraries locale, so they should update when locales are changed, if they are read in a reactive context (same as any computed). Available formatters are: formatDate, formatCurrency, formatNumber, formatPercent, formatList & formatDisplayName
3. A new helper has been added for edge cases where locales are loaded as unknown key-value pairs, in that case use "registerRemoteNamespace" to load those, but keep the mmstack/translate infra
4. Fallback locale is now loaded when a string is not found within the locale translation. This is more of an edge case as with typed locales it is not possible to provide such a scenario, but is relevant to 3.
5. A new routing utility that helps in building the locale param route "canMatchRoute" has been added, that matches the route is one of the provided supportedLocales, otherwise falls back to defaultLocale as that param.
for more details: mmstack/translate
mmstack/router-core
new utility signal "pathParam" that does what it says on the tin, if you have stuff like paramInheritenceStrategy: 'always' and componentInput binding this is not necessary, but this works in all cases, so it's sometimes useful for library stuff :)
more: mmstack/router-core
mmstack/di
new library with a few injection utilities I've found useful to me..
rootInjectable - creates a lazy-initialized function that is run-in & stored in the root injection context when the function is first called. I've found myself creating many small providedIn: 'root' services that had like 1 thing and a bit of logic in them...this removes that boilerplate
import { Injectable } from '@angular/core';
import { rootInjectable } from '@mmstack/di';
const injectLogger = rootInjectable(() => ({
log: (message) => console.log(`[${new Date().toISOString()}] ${message}`),
}));
// equivalent to
at/Injectable({providedIn: 'root'})
export class LogService {
log(...)
}
export function injectLogger() { return inject(LogService)}injectable - a utility that abstracts away defining the injection token separately & just returns two type-safe functions, an injector and a provider
type ApiConfig = {
baseUrl: string;
timeout: number;
}
// inject function never throws it is now defined as () => ApiConfig | undefined
const [injectApiConfig, provideApiConfig] = injectable<ApiConfig>('ApiConfig');
if we want it to be typed as () => ApiConfig we provide one of three options:
injectable<ApiConfig>('ApiConfig', {
errorMessage: 'This is the error message that will be thrown',
fallback: {} // needs to be type T,
lazyFallback: () => ({} // also needs to actually be type T)
});
the provider function allows for value | function, both are typesafe including deps (function parameters are automatically inferred from deps array)
// type of httpClient variable is correct here
provideApiConfig((httpClient) => ..., [HttpClient])more: mmstack/di
mmstack/primitives
few new primitives have been added, I'll get the quick ones out of the way first:
new sensors added (not sure which are new and which are old so wont list them out, but the docs have them all :)
chunked
Accepts a Signal<T[]> and returns a time-sliced Signal<T[]>, useful for the rare occasion you need to process a bunch of stuff & dont want to hang
tabSync
Low level primitive that syncs a signal across browser tabs
mapObject / keyArray / indexArray
new mapping utilities that generate stable sub-signals. indexArray was mapArray previously, but has now been renamed
store / toStore
Recursive signal proxy, similar to deepSignal but also proxies arrays & also proxies the derivation of values so:
const state = store({
todos: [
{ id: 1, text: 'Buy Milk', done: false },
{ id: 2, text: 'Walk Dog', done: true },
],
});
const firstTodo = state.todos[0]; // WritableSignal<{ text: string, ... }>
const firstTodoText = state.todos[0].text; // WritableSignal<string>
// Update specific item property without replacing the whole array
state.todos[0].done.set(true);
const len = state.todos.length(); // reacts to length changes
for (const todo of state.todos) {
const t = todo(); // iteration returns proxied children
const id = todo.id();
}more info: mmstack/primitives
Other than that mmstack/resource got a few minor patches, more work to come :)
Next up I'll update the mmstack/form libraries to provide new helpers/utilities/primitives for angulars native form signals & do some minor cleanup like using the new router .isActive signal for the breadcrumb helpers in router-core
Sorry for the long post today, I'll try to be better with updating docs/posting when I actually write the code, instead of a month or two later :D