MCPcopy Index your code
hub / github.com/angular/angular / attachDebugGetter

Function attachDebugGetter

packages/core/src/render3/i18n/i18n_parse.ts:105–113  ·  view source on GitHub ↗

* Patch a `debug` property getter on top of the existing object. * * NOTE: always call this method with `ngDevMode && attachDebugObject(...)` * * @param obj Object to patch * @param debugGetter Getter returning a value to patch

(obj: T, debugGetter: (this: T) => any)

Source from the content-addressed store, hash-verified

103 * @param debugGetter Getter returning a value to patch
104 */
105function attachDebugGetter<T>(obj: T, debugGetter: (this: T) => any): void {
106 if (ngDevMode) {
107 Object.defineProperty(obj, 'debug', {get: debugGetter, enumerable: false});
108 } else {
109 throw new Error(
110 'This method should be guarded with `ngDevMode` so that it can be tree shaken in production!',
111 );
112 }
113}
114
115/**
116 * Create dynamic nodes from i18n translation block.

Callers 4

i18nStartFirstCreatePassFunction · 0.85
i18nAttributesFirstPassFunction · 0.85
parseIcuCaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…