Angular fundamentals for a .NET developer: standalone components, templates and binding, services and hierarchical DI, HttpClient with interceptors, signals and zoneless change detection, and a comparison with React.
Angular is a full framework. An app is a tree of standalone components, each a TypeScript class with a template that binds data: {{ value }} for text, [property] for inputs, (event) for outputs. Logic and data access live in services that Angular's dependency injection supplies, with root-level singletons and component-level providers, which feels very familiar to .NET developers.
The API is called through HttpClient, which returns RxJS Observables and supports interceptors for auth headers and error handling. Modern Angular uses signals for state and zoneless change detection (the default for new apps since Angular 21; Angular 22 is current).
Compared with React, Angular gives you the router, forms, DI and testing out of the box, at the cost of more concepts (RxJS, decorators) and a steeper start.
"Angular is the frontend framework that feels most like ASP.NET Core. You build standalone components: a TypeScript class with a template and styles, declared with the
@Componentdecorator. The template binds to the class: double braces for text, square brackets for properties, round brackets for events. Shared logic goes in services, which Angular creates and injects, so I mark a service@Injectable({ providedIn: 'root' })to get an app-wide singleton, or provide it on a component to get one instance per component subtree. That hierarchy is Angular's version of lifetimes.To call my ASP.NET Core API, I inject
HttpClientinto a service such asOrdersServiceand expose methods returning typed Observables. Cross-cutting things go in interceptors, which are likeDelegatingHandlers: one adds the antiforgery header or bearer token, another maps 401 to a redirect and ProblemDetails to friendly messages. In current Angular, state increasingly lives in signals:signal(),computed()andeffect(). With signals Angular knows exactly which views depend on which values, so new apps run zoneless without zone.js patching every async API.The mistake I see is people subscribing to Observables manually in components and never unsubscribing, which leaks memory and fires duplicate requests. Use the
asyncpipe,toSignal()ortakeUntilDestroyed(). Compared with React, Angular is opinionated: one router, one forms story, one DI container. For a large .NET team that consistency is often worth the steeper learning curve."
| Concept | What it does | .NET analogy |
|---|---|---|
| Standalone component | Class + template + styles | Razor component |
| Template binding | {{ }}, [prop], (event), @if, @for |
Razor syntax |
Service + @Injectable |
Reusable logic, data access | Registered service |
providedIn: 'root' |
App-wide singleton | AddSingleton |
Component providers |
One instance per component subtree | Roughly AddScoped per scope |
HttpClient + interceptors |
HTTP with a pipeline | HttpClient + DelegatingHandler |
| Signals | Reactive state with fine-grained updates | INotifyPropertyChanged, but automatic |
| Router + guards | Navigation, lazy loading, route protection | Endpoint routing + filters |
| Dimension | Angular | React |
|---|---|---|
| Scope | Full framework | UI library plus your choices |
| DI | Built in, hierarchical | None (Context, props) |
| Async model | RxJS Observables + signals | Promises + hooks |
| Forms | Reactive forms, signal forms (stable in v22) | Third-party (React Hook Form) |
| Learning curve | Steeper at the start | Easier start, more decisions later |
| Hiring in Australia | Common in enterprise and government | Most common overall |
As of November 2026, Angular 22 is current; the team has moved to a yearly major cycle, with Angular 23 expected around mid-2027.
On a government portal with [N] developers, moving auth and error handling into two HttpClient interceptors removed about 40 copies of try/catch and header code from components, and replacing manual subscriptions with toSignal() fixed a leak that grew the tab's memory by roughly 150 MB over a working day.
Checks whether the candidate can read and work in an Angular codebase that calls their API and can compare it fairly with React.
Green flags
Red flags
$scopeA standalone component declares its own imports, so there is no NgModule to maintain. Templates use the built-in control flow @if, @for (item of items; track item.id) and @switch. The track expression plays the same role as React's key.
Classic Angular used zone.js to monkey-patch setTimeout, promises and DOM events, then re-check the whole component tree after any async work. It was simple but wasteful.
old: any async event ──► zone.js ──► check every component
new: signal.set(x) ──► Angular marks only dependent views ──► update
With signals, a template that reads orders() registers a dependency. When orders.set(...) runs, only those views are marked dirty. New apps are zoneless by default since Angular 21.
Angular has a tree of injectors: the environment (root) injector and an element injector per component. When a component asks for a service, Angular walks up the tree until a provider is found. Providing a service on a component gives each instance of that component its own copy, which is useful for per-screen state such as a wizard. inject() is the modern way to request a dependency inside a constructor context or field initialiser.
HttpClient.get<T>() returns a cold Observable: nothing is sent until someone subscribes, and each subscription sends a new request. Operators such as switchMap cancel the previous request when a new search term arrives, the equivalent of aborting with a CancellationToken. Interceptors are functions registered with provideHttpClient(withInterceptors([...])). Angular's HttpClient can also read the XSRF-TOKEN cookie and send it as the X-XSRF-TOKEN header, which matches what ASP.NET Core antiforgery can be configured to expect.
toSignal(observable) subscribes and unsubscribes with the component's lifetime; toObservable(signal) goes the other way. The new httpResource() and resource() APIs wrap requests as signals with loading and error state.
The Angular CLI (ng new, ng generate, ng build) uses esbuild and Vite under the hood. In development, proxy.conf.json forwards /api to the ASP.NET Core backend so the browser sees one origin.
ng new orders --standalone and generate an OrdersService with ng g s orders.toSignal() and @for ... track.switchMap and watch cancelled requests in the Network tab.A Minimal API endpoint and an Angular service, component, interceptor and lazy-loaded route calling it.
// Program.cs (.NET 10)
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/api/orders", () => TypedResults.Ok(new OrderDto[]
{
new(1, "ACME Pty Ltd", 120.50m),
new(2, "Bondi Bikes", 89.00m),
}));
app.Run();
public sealed record OrderDto(int Id, string Customer, decimal Total);
// orders.service.ts
import { Injectable, inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
export interface Order { id: number; customer: string; total: number; }
@Injectable({ providedIn: 'root' }) // app-wide singleton, like AddSingleton
export class OrdersService {
private readonly http = inject(HttpClient);
getOrders() { return this.http.get
.subscribe() in a component and never unsubscribing. Why it is wrong: Long-lived Observables keep the component alive and keep firing. Instead: Use the async pipe, toSignal() or takeUntilDestroyed().HttpClient Observable. Why it is wrong: HttpClient Observables are cold, so each subscription sends another request. Instead: Subscribe once, or share the result with a signal or shareReplay.providedIn: 'root' or component providers deliberately, as you would choose a .NET lifetime.For .NET teams Angular's main selling point is not technical superiority but consistency: DI, typed services, one router with lazy loading and guards, one forms story and a CLI that generates the same structure every time. That reduces design debate on large teams and makes onboarding .NET developers easier. The cost is RxJS, which many developers use badly; modern Angular reduces that by pushing signals for state and keeping RxJS for genuinely stream-shaped problems such as search-as-you-type.
Error handling splits cleanly: the ASP.NET Core API returns ProblemDetails with the right status code, and one Angular interceptor turns 401 into a redirect and 400 validation errors into field messages, so components never parse HTTP errors themselves. Versions checked November 2026: Angular 22 is current, and from v22 Angular moved to a yearly major cycle, so Angular 23 is planned for around mid-2027.
When I compare frameworks I look at the team and the next five years, not benchmarks: who will maintain it, what the organisation already runs, and the hiring market.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Angular | Large teams, long-lived enterprise apps, strong appetite for conventions | Steeper learning, RxJS | Small marketing sites, quick prototypes |
| React | Wide talent pool, varied UIs, need for ecosystem choice | Many decisions to standardise | Teams that will not invest in conventions |
| Blazor | .NET-only team, internal LOB apps | Smaller ecosystem, WebAssembly download or server circuits | Public sites needing fast first load on mobile |
CSRF makes a victim's browser send a state-changing request to your site from another site; it works because the browser attaches cookies automatically. If you authenticate with cookies, you're exposed; if callers send a bearer token in the Authorization header, a cross-site page can't add it, so classic CSRF doesn't apply.
ASP.NET Core's antiforgery uses a synchroniser token: a cookie token plus a token in the form or a header, validated together. MVC forms get it from the form tag helper with [ValidateAntiForgeryToken] or the global auto-validate filter; Razor Pages validate POSTs by default; Minimal APIs need AddAntiforgery/UseAntiforgery and validate form-bound endpoints. SameSite=Lax (the default for ASP.NET Core auth cookies) blocks most cross-site POSTs, but not attacks from a sibling subdomain or GETs that change state, so keep tokens.
The same-origin policy stops JavaScript on one origin (scheme + host + port) from reading responses from another, so a malicious page can't read your bank's API with your cookies. CORS is the server's way to opt in. For a simple request (GET, HEAD or POST with only safelisted headers and a form or text/plain body) the browser sends it and then checks Access-Control-Allow-Origin before handing the response to your code. Anything else, such as a JSON POST, a PUT or an Authorization header, first gets an OPTIONS preflight asking permission for that method and those headers. Sending cookies needs credentials: 'include' and Access-Control-Allow-Credentials: true with an explicit origin. The key trade-off: the browser enforces it but the server's headers decide, and CORS is not security for your API: non-browser clients ignore it.
A signal is a value wrapper that tracks who reads it: count = signal(0), read with count(), change with set or update. computed() derives values lazily and memoises them, and effect() runs side effects. When a template reads a signal, Angular records the dependency, so a change marks only the views that use it.
With zone.js, Angular patched every async API (timers, promises, DOM events) and ran change detection over the component tree after any of them, whether or not data changed. Signals enable zoneless change detection, the default for new apps since Angular 21 (checked November 2026; existing apps can still run with zone.js and migrate gradually). The benefits are fewer checks, a smaller bundle without zone.js, clearer stack traces and simpler state: plain signals in a service replace many hand-rolled BehaviorSubject stores. RxJS remains the tool for event streams.
Last updated 23 Nov 2026.