How to use the ngx-device-detector.DeviceDetectorModule.forRoot function in ngx-device-detector

To help you get started, we’ve selected a few ngx-device-detector 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 Sunbird-Ed / SunbirdEd-portal / src / app / client / src / app / app.module.offline.ts View on Github external
import { DeviceDetectorModule } from 'ngx-device-detector';
 import { BootstrapFramework, WebExtensionModule } from '@project-sunbird/web-extensions';
 import { WebExtensionsConfig, PluginModules } from './framework.config.offline';
@NgModule({
  declarations: [
  ],
  imports: [
    CoreModule,
    CommonModule,
    BrowserModule,
    HttpClientModule,
    SuiModule,
    SharedModule.forRoot(),
    WebExtensionModule.forRoot(),
    TelemetryModule.forRoot(),
    DeviceDetectorModule.forRoot(),
    SharedFeatureModule,
    PluginModules,
    AppRoutingOfflineModule // don't add any module below this because it contains wildcard route
  ],
  entryComponents: [AppComponent],
  bootstrap: [AppComponent],
  providers: [
    CacheService,
    { provide: CacheStorageAbstract, useClass: CacheSessionStorage },
  ]
})
export class AppModuleOffline {
  constructor(bootstrapFramework: BootstrapFramework) {
    bootstrapFramework.initialize(WebExtensionsConfig);
  }
}
github Sunbird-Ed / SunbirdEd-portal / src / app / client / src / app / app.module.ts View on Github external
import { PluginModules } from './framework.config';
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserAnimationsModule, // used this instaed of browser module since it includes in it.
    CoreModule,
    CommonModule,
    HttpClientModule,
    SuiSelectModule, SuiModalModule, SuiAccordionModule, SuiPopupModule, SuiDropdownModule, SuiProgressModule,
    SuiRatingModule, SuiCollapseModule,
    SharedModule.forRoot(),
    WebExtensionModule.forRoot(),
    TelemetryModule.forRoot(),
    DeviceDetectorModule.forRoot(),
    SharedFeatureModule,
    ...PluginModules,
    AppRoutingModule // don't add any module below this because it contains wildcard route
  ],
  entryComponents: [AppComponent],
  bootstrap: [AppComponent],
  providers: [
    CacheService,
    { provide: CacheStorageAbstract, useClass: CacheSessionStorage },
    // { provide: HTTP_INTERCEPTORS, useClass: SessionExpiryInterceptor, multi: true }
  ]
})
export class AppModule {
  constructor(bootstrapFramework: BootstrapFramework) {
    bootstrapFramework.initialize(WebExtensionsConfig);
  }
github KoderLabs / ngx-device-detector / playground / index.ts View on Github external
})
class AppComponent {
  propsToShow = ["userAgent", "os", "browser", "device", "os_version", "browser_version"];
  device: DeviceInfo = null;
  constructor(private deviceService: DeviceDetectorService){
    this.device = deviceService.getDeviceInfo();
    console.log(this.device);
    console.log('isMobile', this.deviceService.isMobile());
    console.log('isTablet', this.deviceService.isTablet());
  }
}

@NgModule({
  bootstrap: [ AppComponent ],
  declarations: [ AppComponent, KeysPipe ],
  imports: [ BrowserModule, DeviceDetectorModule.forRoot() ]
})
class AppModule {}

platformBrowserDynamic().bootstrapModule(AppModule);
github Lumeer / web-ui / src / app / core / core.module.ts View on Github external
FormsModule,
    HttpClientModule,
    RouterModule,
    SharedModule,
    ClickOutsideModule,
    GuardsModule,
    BrowserAnimationsModule,
    NotificationsModule,
    AlertModule.forRoot(),
    BsDatepickerModule.forRoot(),
    BsDropdownModule.forRoot(),
    PopoverModule.forRoot(),
    ModalModule.forRoot(),
    TimepickerModule.forRoot(),
    TypeaheadModule.forRoot(),
    DeviceDetectorModule.forRoot(),
  ],
  declarations: [HomeComponent, RedirectComponent],
  providers: [
    {
      provide: ErrorHandler,
      useClass: SentryErrorHandler,
    },
    httpInterceptorProviders,
    CollectionService,
    DocumentService,
    OrganizationService,
    ProjectService,
    SearchService,
    BaseService,
    ImportService,
    UserService,
github KoderLabs / ngx-device-detector / demo / src / app / app.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        DeviceDetectorModule.forRoot()
      ],
      declarations: [
        AppComponent,
        KeysPipe
      ],
      providers: []
    }).compileComponents();
  }));
github GNS3 / gns3-web-ui / src / app / app.module.ts View on Github external
AppRoutingModule,
    FormsModule,
    ReactiveFormsModule,
    BrowserAnimationsModule,
    CdkTableModule,
    CartographyModule,
    HotkeyModule.forRoot(),
    PersistenceModule,
    NgxElectronModule,
    FileUploadModule,
    MatSidenavModule,
    ResizableModule,
    DragAndDropModule,
    DragDropModule,
    MATERIAL_IMPORTS,
    DeviceDetectorModule.forRoot()
  ],
  providers: [
    SettingsService,
    { provide: ErrorHandler, useClass: ToasterErrorHandler },
    D3Service,
    VersionService,
    ProjectService,
    SymbolService,
    ServerService,
    TemplateService,
    NodeService,
    LinkService,
    DrawingService,
    IndexedDbService,
    HttpServer,
    SnapshotService,
github bdeployteam / bdeploy / ui / webapp / src / app / app.module.ts View on Github external
import { CoreModule } from './modules/core/core.module';
import { SharedModule } from './modules/shared/shared.module';

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    CoreModule,
    SharedModule,
    AppRoutingModule,
    LoadingBarHttpClientModule,
    LoadingBarRouterModule,
    DeviceDetectorModule.forRoot(),
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}
github KoderLabs / ngx-device-detector / demo / src / app / app.module.ts View on Github external
import { KeysPipe } from './pipes/keys.pipe';
import { CommonModule } from '@angular/common';
import { DeviceDetectorModule } from 'ngx-device-detector';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

@NgModule({
  declarations: [
    AppComponent,
    KeysPipe
  ],
  imports: [
    NoopAnimationsModule,
    BrowserModule.withServerTransition({ appId: 'serverApp' }),
    CommonModule,
    DeviceDetectorModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

ngx-device-detector

<p align="center"> <img src="https://raw.githubusercontent.com/AhsanAyaz/ngx-device-detector/master/assets/logo.svg" width="200"> </p>

MIT
Latest version published 4 months ago

Package Health Score

78 / 100
Full package analysis