ng-origin

Alt+Click any element.
Copy where it comes from.

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.

Voice: elevenlabs.io · Music: “Circuit Synthwave” by Doctor_Dreamchip (CC0)

How it works

01Hold Alt or ⌥

The element under the pointer gets an outline and a label: button in Widget.

02Alt or ⌥ + Click

The origin block goes to your clipboard. The click never reaches the app.

03Paste it

Your agent opens the right file with the right context, without searching the codebase.

What gets copied

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).

Install

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.

Keys

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'.

Good to know

Angular 20–22. Majors follow Angular.
Dev mode only. Production builds drop it.
No data leaves the page. No network, no storage.