On a Mac: ⌥ Option + Click
A dev-mode tool for Angular apps. It copies the route, the component that declares the element, its template file, the library it sits in and its translation keys, as plain text for your coding agent.
The element under the pointer gets an outline and a label: button in Widget.
The origin block goes to your clipboard. The click never reaches the app.
Your agent opens the right file with the right context, without searching the codebase.
Page: /dashboard · route dashboard → DashboardPage (src/app/dashboard/dashboard-page.ts:13)
Element: <button> "Archive"
Inside: UiButton <button ui-button> (ui-kit) · variant=primary
Declared in: Widget (src/app/widget/widget.ts:15)Projected into: CardShell (src/app/card-shell/card-shell.ts:13)
Template: src/app/widget/widget.html:2Find: widget.archive
Chain: Widget > DashboardPage
Context: lang=en · viewport=1440×900 (xl)
Not the wrapper, not the library: the component that declares the element, and its template line (Angular
22.1.4+ with enableTemplateSourceLocations in a development tsconfig).
npm i -D ng-origin
// app.config.ts
import { ApplicationConfig, isDevMode } from '@angular/core';
import { provideNgOrigin } from 'ng-origin';
export const appConfig: ApplicationConfig = {
providers: [isDevMode() ? [provideNgOrigin()] : []],
};
NgModule apps add it to the root module's providers. Options for library prefixes, breakpoints and translation keys are in the README.
| Windows, Linux | Mac | |
|---|---|---|
| Outline and label the element under the pointer | Hold Alt | Hold ⌥ |
| Copy its origin block | Alt+Click | ⌥ Click |
| Append another block to the last one | Alt+Shift+Click | ⌥⇧ Click |
⌥ is the Option key, ⇧ is Shift. Rather use Ctrl+Shift on Windows or Linux? Set
modifier: 'ctrl-shift'.