How to use @nebular/theme - 10 common examples

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);
github garrylachman / ElectroCRUD / src / app / app.module.ts View on Github external
ConfirmDeleteComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpClientModule,
    AppRoutingModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: (HttpLoaderFactory),
        deps: [HttpClient]
      }
    }),
    BrowserAnimationsModule,
    NbThemeModule.forRoot({ name: 'cosmic' }),
    NbLayoutModule,
    NbEvaIconsModule,
    NbSidebarModule.forRoot(), // NbSidebarModule.forRoot(), //if this is your app.module
    NbButtonModule,
    NbActionsModule,
    NbSearchModule,
    NbIconModule,
    NbMenuModule.forRoot(),
    NbTooltipModule,
    NbCardModule,
    NbInputModule,
    NbCheckboxModule,
    NbSelectModule,
    NbDialogModule.forRoot(),
    NgxMaskModule.forRoot(),
    NbToastrModule.forRoot(),
github garrylachman / ElectroCRUD / src / app / app.module.ts View on Github external
loader: {
        provide: TranslateLoader,
        useFactory: (HttpLoaderFactory),
        deps: [HttpClient]
      }
    }),
    BrowserAnimationsModule,
    NbThemeModule.forRoot({ name: 'cosmic' }),
    NbLayoutModule,
    NbEvaIconsModule,
    NbSidebarModule.forRoot(), // NbSidebarModule.forRoot(), //if this is your app.module
    NbButtonModule,
    NbActionsModule,
    NbSearchModule,
    NbIconModule,
    NbMenuModule.forRoot(),
    NbTooltipModule,
    NbCardModule,
    NbInputModule,
    NbCheckboxModule,
    NbSelectModule,
    NbDialogModule.forRoot(),
    NgxMaskModule.forRoot(),
    NbToastrModule.forRoot(),
    ReactiveFormsModule,
    NbAlertModule,
    FormlyModule.forRoot(),
    NbDatepickerModule.forRoot(),
    FormlyBootstrapModule,
    Ng2FittextModule,
    NgBootstrapFormValidationModule.forRoot(),
  ],
github garrylachman / ElectroCRUD / src / app / app.module.ts View on Github external
BrowserModule,
    FormsModule,
    HttpClientModule,
    AppRoutingModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: (HttpLoaderFactory),
        deps: [HttpClient]
      }
    }),
    BrowserAnimationsModule,
    NbThemeModule.forRoot({ name: 'cosmic' }),
    NbLayoutModule,
    NbEvaIconsModule,
    NbSidebarModule.forRoot(), // NbSidebarModule.forRoot(), //if this is your app.module
    NbButtonModule,
    NbActionsModule,
    NbSearchModule,
    NbIconModule,
    NbMenuModule.forRoot(),
    NbTooltipModule,
    NbCardModule,
    NbInputModule,
    NbCheckboxModule,
    NbSelectModule,
    NbDialogModule.forRoot(),
    NgxMaskModule.forRoot(),
    NbToastrModule.forRoot(),
    ReactiveFormsModule,
    NbAlertModule,
    FormlyModule.forRoot(),
github garrylachman / ElectroCRUD / src / app / app.module.ts View on Github external
BrowserAnimationsModule,
    NbThemeModule.forRoot({ name: 'cosmic' }),
    NbLayoutModule,
    NbEvaIconsModule,
    NbSidebarModule.forRoot(), // NbSidebarModule.forRoot(), //if this is your app.module
    NbButtonModule,
    NbActionsModule,
    NbSearchModule,
    NbIconModule,
    NbMenuModule.forRoot(),
    NbTooltipModule,
    NbCardModule,
    NbInputModule,
    NbCheckboxModule,
    NbSelectModule,
    NbDialogModule.forRoot(),
    NgxMaskModule.forRoot(),
    NbToastrModule.forRoot(),
    ReactiveFormsModule,
    NbAlertModule,
    FormlyModule.forRoot(),
    NbDatepickerModule.forRoot(),
    FormlyBootstrapModule,
    Ng2FittextModule,
    NgBootstrapFormValidationModule.forRoot(),
  ],
  providers: [
    ElectronService, 
    NbMenuService, 
    NbDialogService, 
    AccountsService, 
    NbDatepickerDirective,
github garrylachman / ElectroCRUD / src / app / app.module.ts View on Github external
NbLayoutModule,
    NbEvaIconsModule,
    NbSidebarModule.forRoot(), // NbSidebarModule.forRoot(), //if this is your app.module
    NbButtonModule,
    NbActionsModule,
    NbSearchModule,
    NbIconModule,
    NbMenuModule.forRoot(),
    NbTooltipModule,
    NbCardModule,
    NbInputModule,
    NbCheckboxModule,
    NbSelectModule,
    NbDialogModule.forRoot(),
    NgxMaskModule.forRoot(),
    NbToastrModule.forRoot(),
    ReactiveFormsModule,
    NbAlertModule,
    FormlyModule.forRoot(),
    NbDatepickerModule.forRoot(),
    FormlyBootstrapModule,
    Ng2FittextModule,
    NgBootstrapFormValidationModule.forRoot(),
  ],
  providers: [
    ElectronService, 
    NbMenuService, 
    NbDialogService, 
    AccountsService, 
    NbDatepickerDirective,
    {
      provide: ErrorHandler,
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);
github akveo / nebular / src / framework / theme / components / cdk / overlay / overlay-position.spec.ts View on Github external
it('should map right position to end', () => {
    const withPositionsSpy = spyOn(strategy, 'withPositions').and.callThrough();

    strategy.position(NbPosition.RIGHT).adjustment(NbAdjustment.HORIZONTAL);

    const overlayService: NbOverlayService = TestBed.get(NbOverlayService);
    const overlayRef = overlayService.create({ positionStrategy: strategy });
    overlayRef.attach(new NbComponentPortal(PortalComponent));

    expect(withPositionsSpy).toHaveBeenCalledWith(jasmine.objectContaining([
      { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 15 },
      { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -15 },
    ]));
  });
});
github akveo / nebular / src / framework / theme / components / cdk / overlay / overlay-container.spec.ts View on Github external
it('should set context before change detection run', () => {
    const context = { contextProperty: 'contextProperty' };
    const portal: NbComponentPortal = new NbComponentPortal(NbOverlayTestComponent);
    const portalRef = overlayContainer.attachComponentPortal(portal, context);

    expect(portalRef.instance.contextPropertyValueOnFirstCdRun).toEqual(context.contextProperty);
  });
});