![TypeScript code in a dark editor tab named cart.service.ts. A CartService keeps a private writable signal _items and exposes it as items = this._items.asReadonly(), highlighted. It also has a computed total of the item prices and an add(item) method that updates _items. Below, a CartBadge component injects CartService and shows the item count and total. Its clear() method calls this.cart.items.set([]), highlighted with the comment "Error: Property 'set' does not exist on type 'Signal<CartItem[]>'".](https://pbs.twimg.com/media/HXPWOjbWgAAgcf8.jpg?name=small&format=webp)
ALT TypeScript code in a dark editor tab named cart.service.ts. A CartService keeps a private writable signal _items and exposes it as items = this._items.asReadonly(), highlighted. It also has a computed total of the item prices and an add(item) method that updates _items. Below, a CartBadge component injects CartService and shows the item count and total. Its clear() method calls this.cart.items.set([]), highlighted with the comment "Error: Property 'set' does not exist on type 'Signal<CartItem[]>'".
![Angular TypeScript code in a dark editor tab named product-search.ts. First, search.worker.ts: a message listener that runs searchProducts on the incoming data and posts the result back on ports[0]. Then a helper, runInWorker, that creates a new MessageChannel, posts the data to the worker together with port2 (highlighted), and returns a Promise that resolves when port1 receives the answer. Then a ProductSearch component: its template has an input that sets the query signal and a @for loop over results.value() showing each product name. The class creates the worker with new Worker(new URL('./search.worker', import.meta.url)) (highlighted), a query signal, and a results resource with params set to the query and a loader that calls runInWorker with the worker and the params (highlighted).](https://pbs.twimg.com/media/HW2FiFOWAAEUuhb.jpg?name=small&format=webp)
ALT Angular TypeScript code in a dark editor tab named product-search.ts. First, search.worker.ts: a message listener that runs searchProducts on the incoming data and posts the result back on ports[0]. Then a helper, runInWorker, that creates a new MessageChannel, posts the data to the worker together with port2 (highlighted), and returns a Promise that resolves when port1 receives the answer. Then a ProductSearch component: its template has an input that sets the query signal and a @for loop over results.value() showing each product name. The class creates the worker with new Worker(new URL('./search.worker', import.meta.url)) (highlighted), a query signal, and a results resource with params set to the query and a loader that calls runInWorker with the worker and the params (highlighted).

ALT Infographic titled "Where did all my RxJS operators go?" with the line "In Angular 22, most of them became signals." Five RxJS operators, each with an arrow down to the Angular signal API that replaced it: BehaviorSubject to signal(), combineLatest to computed(), debounceTime to debounced(), switchMap to httpResource(), and subscribe to effect(). Below, a timeline labeled "Still RxJS" with exhaustMap, concatMap, retry and webSocket.

ALT TypeScript code in a dark editor tab named copy-table.ts. An async function copyTable takes rows as an array of string arrays. A comment says "for Notepad, Slack, terminals: tab-separated text", and the code joins each row with tabs and the rows with new lines. A second comment says "for Excel, Google Sheets, Gmail: a real table", and the code builds an HTML table: a td for each cell, a tr for each row, wrapped in a table tag. Then it calls navigator.clipboard.write with one new ClipboardItem holding two versions (highlighted): 'text/plain' as a Blob of the text, and 'text/html' as a Blob of the HTML. Below, copyTable is called with a header row Order, Customer, Total and two order rows: 1042, guest, 49.90 and 1043, guest, 120.00.

ALT TypeScript and Angular code in share-link.ts. Function pack(state) turns JSON.stringify(state) into a Blob stream, pipes it through new CompressionStream('deflate-raw'), reads the bytes with new Response(zipped).bytes() and returns bytes.toBase64({ alphabet: 'base64url', omitPadding: true }). Function unpack<T>(text) does the reverse with Uint8Array.fromBase64, DecompressionStream('deflate-raw') and new Response(unzipped).json(). Below, an Angular component Orders with a "Copy link" button. It has a state input (the ?state=... URL param), a resource with params: this.state and loader: unpack<View>(params), and view = linkedSignal(() => this.shared.value() ?? defaultView). Its share() method sets the 'state' URL param to await pack(this.view()) and copies the URL to the clipboard. The CompressionStream, toBase64 and state input lines are highlighted.
![Angular code in broadcast-signal.ts. First, export function broadcastSignal<T>(name: string, initial: T). Inside: const channel = new BroadcastChannel(name); const synced = signal(initial); const value = linkedSignal(() => synced()). Then channel.onmessage = (event: MessageEvent<T>) => synced.set(event.data); and inject(DestroyRef).onDestroy(() => channel.close()). Then an effect: if (value() !== synced()) { channel.postMessage(value()); synced.set(value()); }, and the function returns value. Next, an @Service() class Auth with readonly user = broadcastSignal<User | null>('user', readSession()); and private readonly router = inject(Router). Its constructor runs an effect: if (!this.user()) { this.router.navigate(['/login']); }. Its logout() method calls this.user.set(null). The postMessage line, the navigate line and the this.user.set(null) line are highlighted.](https://pbs.twimg.com/media/HWr_DkpWUAAOqp_.jpg?name=small&format=webp)
ALT Angular code in broadcast-signal.ts. First, export function broadcastSignal<T>(name: string, initial: T). Inside: const channel = new BroadcastChannel(name); const synced = signal(initial); const value = linkedSignal(() => synced()). Then channel.onmessage = (event: MessageEvent<T>) => synced.set(event.data); and inject(DestroyRef).onDestroy(() => channel.close()). Then an effect: if (value() !== synced()) { channel.postMessage(value()); synced.set(value()); }, and the function returns value. Next, an @Service() class Auth with readonly user = broadcastSignal<User | null>('user', readSession()); and private readonly router = inject(Router). Its constructor runs an effect: if (!this.user()) { this.router.navigate(['/login']); }. Its logout() method calls this.user.set(null). The postMessage line, the navigate line and the this.user.set(null) line are highlighted.

ALT TypeScript code in greeting.ts. A first comment says tsconfig.json has "erasableSyntaxOnly": true. Below, marked with a red cross and "error TS1294": enum Status { Active, Archived }. Then, marked with a green check and "decorators are fine": an Angular @Component with selector app-greeting and the template <p>{{ greeter.greet() }}</p>, for the class Greeting. Inside the class, marked with a red cross and "error TS1294", a commented-out constructor(private greeter: Greeter) {}. Then, marked with a green check and "OK": readonly greeter = inject(Greeter).
![JavaScript code in folder.js. A class Folder has a constructor(name, children = []) that stores this.name and this.children. It has a generator method *[Symbol.iterator]() (highlighted) that does yield this; then, for (const child of this.children), yield* child. Usage: const src = new Folder('src', [new Folder('app', [new Folder('pages')]), new Folder('assets')]). Then [...src].map((folder) => folder.name) gives ['src', 'app', 'pages', 'assets'].](https://pbs.twimg.com/media/HWR4fanWcAA5L0P.jpg?name=small&format=webp)
ALT JavaScript code in folder.js. A class Folder has a constructor(name, children = []) that stores this.name and this.children. It has a generator method *[Symbol.iterator]() (highlighted) that does yield this; then, for (const child of this.children), yield* child. Usage: const src = new Folder('src', [new Folder('app', [new Folder('pages')]), new Folder('assets')]). Then [...src].map((folder) => folder.name) gives ['src', 'app', 'pages', 'assets'].
![Angular code in tabs.ts. A component with selector 'app-tabs'. Its template loops with @for (tab of tabs(); track tab) and renders a button for each tab: (click)="active.set(tab)" with the text {{ tab.label() }}. After the loop is <ng-content />. The class Tabs has readonly tabs = contentChildren(Tab) (highlighted) and readonly active = linkedSignal(() => this.tabs()[0]). A comment shows the usage: <app-tabs> containing <app-tab label="Profile">...</app-tab> and <app-tab label="Settings">...</app-tab>.](https://pbs.twimg.com/media/HWSLqghWYAEXmEH.jpg?name=small&format=webp)
ALT Angular code in tabs.ts. A component with selector 'app-tabs'. Its template loops with @for (tab of tabs(); track tab) and renders a button for each tab: (click)="active.set(tab)" with the text {{ tab.label() }}. After the loop is <ng-content />. The class Tabs has readonly tabs = contentChildren(Tab) (highlighted) and readonly active = linkedSignal(() => this.tabs()[0]). A comment shows the usage: <app-tabs> containing <app-tab label="Profile">...</app-tab> and <app-tab label="Settings">...</app-tab>.
![TypeScript code in room-feed.ts. An Angular component app-room-feed whose template loops over messages() and shows each message in a paragraph. The class RoomFeed has a required input roomId of type string and a signal messages, an empty string array. In the constructor, effect((onCleanup) => { ... }) (highlighted) creates new EventSource(`/api/rooms/${this.roomId()}/events`) and, on each message, appends event.data to messages. Then, after the comment "Runs before the next run (new roomId) and on destroy", onCleanup(() => { source.close(); this.messages.set([]); }) is highlighted.](https://pbs.twimg.com/media/HWHjcktWIAA3rcQ.jpg?name=small&format=webp)
ALT TypeScript code in room-feed.ts. An Angular component app-room-feed whose template loops over messages() and shows each message in a paragraph. The class RoomFeed has a required input roomId of type string and a signal messages, an empty string array. In the constructor, effect((onCleanup) => { ... }) (highlighted) creates new EventSource(`/api/rooms/${this.roomId()}/events`) and, on each message, appends event.data to messages. Then, after the comment "Runs before the next run (new roomId) and on destroy", onCleanup(() => { source.close(); this.messages.set([]); }) is highlighted.
![An Angular component in feed.ts: a scrollable feed (height 600px, overflow auto) where each page is a @defer block. Line 9, highlighted, is @defer (on viewport({ scrollMargin: '600px' })): @Component({ selector: 'app-feed', imports: [FeedPage], styles: `.feed { height: 600px; overflow: auto; }`, template: ` <div class="feed"> @for (page of pages(); track page) { <!-- load each page 600px before it scrolls into the feed --> @defer (on viewport({ scrollMargin: '600px' })) { <app-feed-page [page]="page" /> } @placeholder { <div class="page-placeholder"></div> } } </div> `, }) export class Feed { readonly pages = signal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); }](https://pbs.twimg.com/media/HVuAIhRWIAAK2hn.jpg?name=small&format=webp)
ALT An Angular component in feed.ts: a scrollable feed (height 600px, overflow auto) where each page is a @defer block. Line 9, highlighted, is @defer (on viewport({ scrollMargin: '600px' })): @Component({ selector: 'app-feed', imports: [FeedPage], styles: `.feed { height: 600px; overflow: auto; }`, template: ` <div class="feed"> @for (page of pages(); track page) { <!-- load each page 600px before it scrolls into the feed --> @defer (on viewport({ scrollMargin: '600px' })) { <app-feed-page [page]="page" /> } @placeholder { <div class="page-placeholder"></div> } } </div> `, }) export class Feed { readonly pages = signal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); }
![An Angular component in quantity.ts, a quantity stepper. Lines 4 and 6, highlighted, use quantity-- and quantity++ directly in (click) event bindings: @Component({ selector: 'app-quantity', template: ` <button (click)="quantity--" [disabled]="quantity === 1">-</button> <span>{{ quantity }}</span> <button (click)="quantity++">+</button> `, }) export class Quantity { quantity = 1; // a plain field: `++` on a signal is a type error }](https://pbs.twimg.com/media/HVtwV6kWEAAkapD.jpg?name=small&format=webp)
ALT An Angular component in quantity.ts, a quantity stepper. Lines 4 and 6, highlighted, use quantity-- and quantity++ directly in (click) event bindings: @Component({ selector: 'app-quantity', template: ` <button (click)="quantity--" [disabled]="quantity === 1">-</button> <span>{{ quantity }}</span> <button (click)="quantity++">+</button> `, }) export class Quantity { quantity = 1; // a plain field: `++` on a signal is a type error }
![TypeScript code in product-list.ts. A directive with selector 'ng-template[row]', class RowTemplate<T>, has a required input row of type T[] and injects TemplateRef. Its static method ngTemplateContextGuard<T>(dir: RowTemplate<T>, ctx: unknown) returns ctx is { $implicit: T; index: number } and its body is return true; this part is highlighted. Below, a ProductList component imports Table and RowTemplate and has a required input products of type Product[]. Its template is an app-table with [items]="products()", containing <ng-template [row]="products()" let-product let-i="index">, with a highlighted comment "product: Product, i: number", then {{ i + 1 }}. {{ product.name }}: {{ product.price }}.](https://pbs.twimg.com/media/HVyrVrKXAAAXgaB.jpg?name=small&format=webp)
ALT TypeScript code in product-list.ts. A directive with selector 'ng-template[row]', class RowTemplate<T>, has a required input row of type T[] and injects TemplateRef. Its static method ngTemplateContextGuard<T>(dir: RowTemplate<T>, ctx: unknown) returns ctx is { $implicit: T; index: number } and its body is return true; this part is highlighted. Below, a ProductList component imports Table and RowTemplate and has a required input products of type Product[]. Its template is an app-table with [items]="products()", containing <ng-template [row]="products()" let-product let-i="index">, with a highlighted comment "product: Product, i: number", then {{ i + 1 }}. {{ product.name }}: {{ product.price }}.











