How to use the @nebular/theme.NbOverlayModule.forRoot function in @nebular/theme

To help you get started, we’ve selected a few @nebular/theme examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github akveo / nebular / src / framework / theme / components / cdk / overlay / overlay-container.spec.ts View on Github external
contextProperty;

  isFirstOnChangesCall = true;
  contextPropertyValueOnFirstCdRun;
  ngOnInit() {
    if (this.isFirstOnChangesCall) {
      this.contextPropertyValueOnFirstCdRun = this.contextProperty;
      this.isFirstOnChangesCall = false;
    }
  }
}

// Has to define test module since there is no way to specify entry components
// in 'TestBed.configureTestingModule'.
@NgModule({
  imports: [ NbOverlayModule.forRoot() ],
  declarations: [ NbOverlayContainerTestComponent, NbOverlayTestComponent ],
  entryComponents: [ NbOverlayTestComponent ],
})
export class NbOverlayTestModule {}

describe('NbOverlayContainerComponent', () => {
  let fixture: ComponentFixture;
  let overlayContainer: NbOverlayContainerComponent;

  beforeEach(() => {
    TestBed.configureTestingModule({ imports: [ NbOverlayTestModule ] });

    fixture = TestBed.createComponent(NbOverlayContainerTestComponent);
    fixture.detectChanges();
    overlayContainer = fixture.componentInstance.overlayContainer;
  });
github akveo / nebular / src / framework / theme / components / cdk / overlay / overlay-position.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        NbThemeModule.forRoot(),
        NbOverlayModule.forRoot(),
        NbLayoutModule,
        PortalModule,
        RouterTestingModule.withRoutes([]),
      ],
    });

    // Have to create layout component as it's required for scroll service to work properly.
    // Also it registers overlay container so we don't have to create it manually.
    TestBed.createComponent(NbLayoutComponent);

    overlayHostElement = document.createElement('div');
    overlayHostElement.style.width = '10px';
    overlayHostElement.style.height = '10px';
    overlayHostElement.style.backgroundColor = 'red';
    document.body.appendChild(overlayHostElement);