MCPcopy Index your code
hub / github.com/angular/components / createComponent

Function createComponent

src/material/chips/chip-listbox.spec.ts:917–942  ·  view source on GitHub ↗
(
    component: Type<T>,
    direction: Direction = 'ltr',
    beforeInitialChangeDetection?: (fixture: ComponentFixture<T>) => void,
  )

Source from the content-addressed store, hash-verified

915 });
916
917 function createComponent<T>(
918 component: Type<T>,
919 direction: Direction = 'ltr',
920 beforeInitialChangeDetection?: (fixture: ComponentFixture<T>) => void,
921 ): ComponentFixture<T> {
922 directionality = signal(direction);
923
924 TestBed.configureTestingModule({
925 providers: [provideFakeDirectionality(directionality)],
926 });
927
928 fixture = TestBed.createComponent<T>(component);
929 beforeInitialChangeDetection?.(fixture);
930 fixture.detectChanges();
931
932 chipListboxDebugElement = fixture.debugElement.query(By.directive(MatChipListbox))!;
933 chipListboxNativeElement = chipListboxDebugElement.nativeElement;
934 chipListboxInstance = chipListboxDebugElement.componentInstance;
935 testComponent = fixture.debugElement.componentInstance;
936 chips = chipListboxInstance._chips;
937 primaryActions = chipListboxNativeElement.querySelectorAll<HTMLElement>(
938 '.mdc-evolution-chip__action--primary',
939 );
940
941 return fixture;
942 }
943});
944
945@Component({

Callers 1

Calls 2

signalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…