MCPcopy Create free account
hub / github.com/angular/angular / attachDebugGetter

Function attachDebugGetter

packages/core/src/render3/i18n/i18n_parse.ts:109–117  ·  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

107 * @param debugGetter Getter returning a value to patch
108 */
109function attachDebugGetter<T>(obj: T, debugGetter: (this: T) => any): void {
110 if (ngDevMode) {
111 Object.defineProperty(obj, 'debug', {get: debugGetter, enumerable: false});
112 } else {
113 throw new Error(
114 'This method should be guarded with `ngDevMode` so that it can be tree shaken in production!',
115 );
116 }
117}
118
119/**
120 * 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