MCPcopy
hub / github.com/angular/angular / attachEventsLogger

Function attachEventsLogger

packages/forms/test/form_group_spec.ts:2244–2254  ·  view source on GitHub ↗
(
        control: AbstractControl,
        log: string[],
        controlName?: string,
      )

Source from the content-addressed store, hash-verified

2242
2243 describe('emit `statusChanges` and `valueChanges` with/without async/sync validators', () => {
2244 const attachEventsLogger = (
2245 control: AbstractControl,
2246 log: string[],
2247 controlName?: string,
2248 ) => {
2249 const name = controlName ? ` (${controlName})` : '';
2250 control.statusChanges.subscribe((status) => log.push(`status${name}: ${status}`));
2251 control.valueChanges.subscribe((value) =>
2252 log.push(`value${name}: ${JSON.stringify(value)}`),
2253 );
2254 };
2255
2256 describe('stand alone controls', () => {
2257 it('should run the async validator on stand alone controls and set status to `INVALID`', async () => {

Callers 1

form_group_spec.tsFile · 0.85

Calls 2

subscribeMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…