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

Class TestStrategy

packages/elements/test/create-custom-element_spec.ts:405–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403 }
404
405 class TestStrategy implements NgElementStrategy {
406 connectedElement: HTMLElement | null = null;
407 disconnectCalled = false;
408 inputs = new Map<string, any>();
409
410 events = new Subject<NgElementStrategyEvent>();
411
412 connect(element: HTMLElement): void {
413 this.events.next({name: 'strategy-event', value: 'connect'});
414 this.connectedElement = element;
415 }
416
417 disconnect(): void {
418 this.disconnectCalled = true;
419 }
420
421 getInputValue(propName: string): any {
422 return this.inputs.get(propName);
423 }
424
425 setInputValue(propName: string, value: string, transform?: (value: any) => any): void {
426 this.inputs.set(propName, transform ? transform(value) : value);
427 }
428
429 reset(): void {
430 this.connectedElement = null;
431 this.disconnectCalled = false;
432 this.inputs.clear();
433 }
434 }
435
436 class TestStrategyFactory implements NgElementStrategyFactory {
437 testStrategy = new TestStrategy();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…