How to use the ngx-toastr.ToastrModule.forRoot function in ngx-toastr

To help you get started, we’ve selected a few ngx-toastr 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 lealceldeiro / gms / client / src / app / app.module.ts View on Github external
*/
export function initializeApp(appConfig: AppConfig): () => Promise {
  return () => appConfig.load();
}

/**
 * Base module, bootstrapped in the main file.
 */
@NgModule({
  declarations: [AppComponent, NavBarComponent, SideMenuComponent],
  imports: [
    BrowserModule,
    HttpClientModule,
    NgxUiLoaderModule, // "loader" (spinner) component
    BrowserAnimationsModule, // required by toastr
    ToastrModule.forRoot({ preventDuplicates: true, autoDismiss: true, enableHtml: true }),
    CookieModule.forRoot(),
    NgbModule,
    SharedModule,
    GmsCoreModule.forRoot(),
    HomeModule,
    AppRoutingModule
  ],
  providers: [
    AppConfig,
    {
      provide: APP_INITIALIZER,
      useFactory: initializeApp,
      deps: [AppConfig],
      multi: true
    }
  ],
github TwanoO67 / ngx-admin-lte / src / ngx-admin-lte.module.ts View on Github external
MenuAsideComponent,
    ControlSidebarComponent,
    MessagesBoxComponent,
    NotificationBoxComponent,
    TasksBoxComponent,
    UserBoxComponent,
    ComponentLoaderComponent,
    // LAYOUTS
    LayoutAuthComponent,
    LayoutLoginComponent,
    LayoutRegisterComponent
  ],
  imports: [
    BrowserModule,
    RouterModule,
    ToastrModule.forRoot({
      timeOut: 10000,
      positionClass: 'toast-top-right',
      preventDuplicates: true,
      tapToDismiss: false,
      newestOnTop: true
    }),
    HttpClientModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    }),
  ],
  exports: [
github bpatrik / pigallery2 / frontend / app / app.module.ts View on Github external
return '';
  }
  return require(`raw-loader!../translate/messages.${locale}.xlf`);
}

@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    appRoutes,
    ClipboardModule,
    JwBootstrapSwitchNg2Module,
    TooltipModule.forRoot(),
    ToastrModule.forRoot(),
    ModalModule.forRoot(),
    CollapseModule.forRoot(),
    PopoverModule.forRoot(),
    BsDropdownModule.forRoot(),
    SlimLoadingBarModule.forRoot(),
    BsDatepickerModule.forRoot(),
    YagaModule
  ],
  declarations: [AppComponent,
    LoginComponent,
    ShareLoginComponent,
    GalleryComponent,
    FacesComponent,
    // misc
    FrameComponent,
    LanguageComponent,
github ceph / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cluster / osd / osd-pg-scrub-modal / osd-pg-scrub-modal.component.spec.ts View on Github external
describe('OsdPgScrubModalComponent', () => {
  let component: OsdPgScrubModalComponent;
  let fixture: ComponentFixture;
  let configurationService: ConfigurationService;

  configureTestBed({
    imports: [
      HttpClientTestingModule,
      ModalModule.forRoot(),
      ReactiveFormsModule,
      RouterTestingModule,
      SharedModule,
      ToastrModule.forRoot()
    ],
    declarations: [OsdPgScrubModalComponent],
    providers: [BsModalRef, i18nProviders]
  });

  beforeEach(() => {
    fixture = TestBed.createComponent(OsdPgScrubModalComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
    configurationService = TestBed.get(ConfigurationService);
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
github ceph / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / services / prometheus-alert.service.spec.ts View on Github external
describe('PrometheusAlertService', () => {
  let service: PrometheusAlertService;
  let notificationService: NotificationService;
  let alerts: AlertmanagerAlert[];
  let prometheusService: PrometheusService;
  let prometheus: PrometheusHelper;

  configureTestBed({
    imports: [ToastrModule.forRoot(), SharedModule, HttpClientTestingModule],
    providers: [PrometheusAlertService, PrometheusAlertFormatter, i18nProviders]
  });

  beforeEach(() => {
    prometheus = new PrometheusHelper();
  });

  it('should create', () => {
    expect(TestBed.get(PrometheusAlertService)).toBeTruthy();
  });

  describe('test error cases', () => {
    const expectDisabling = (status, expectation) => {
      let disabledSetting = false;
      const resp = { status: status, error: {} };
      service = new PrometheusAlertService(null, ({
github ceph / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cluster / hosts / hosts.component.spec.ts View on Github external
let hostListSpy;

  const fakeAuthStorageService = {
    getPermissions: () => {
      return new Permissions({ hosts: ['read', 'update', 'create', 'delete'] });
    }
  };

  configureTestBed({
    imports: [
      SharedModule,
      HttpClientTestingModule,
      TabsModule.forRoot(),
      BsDropdownModule.forRoot(),
      RouterTestingModule,
      ToastrModule.forRoot()
    ],
    providers: [{ provide: AuthStorageService, useValue: fakeAuthStorageService }, i18nProviders],
    declarations: [HostsComponent, HostDetailsComponent, InventoryComponent, ServicesComponent]
  });

  beforeEach(() => {
    fixture = TestBed.createComponent(HostsComponent);
    component = fixture.componentInstance;
    hostListSpy = spyOn(TestBed.get(HostService), 'list');
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
github ceph / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cluster / prometheus / silence-list / silence-list.component.spec.ts View on Github external
describe('SilenceListComponent', () => {
  let component: SilenceListComponent;
  let fixture: ComponentFixture;
  let prometheusService: PrometheusService;

  configureTestBed({
    imports: [
      SharedModule,
      BsDropdownModule.forRoot(),
      TabsModule.forRoot(),
      ModalModule.forRoot(),
      ToastrModule.forRoot(),
      RouterTestingModule,
      HttpClientTestingModule
    ],
    declarations: [SilenceListComponent, PrometheusTabsComponent],
    providers: [i18nProviders]
  });

  beforeEach(() => {
    fixture = TestBed.createComponent(SilenceListComponent);
    component = fixture.componentInstance;
    prometheusService = TestBed.get(PrometheusService);
  });

  it('should create', () => {
    fixture.detectChanges();
    expect(component).toBeTruthy();
github ceph / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / iscsi-target-form / iscsi-target-form.component.spec.ts View on Github external
disk_usage: 0
        }
      ],
      pool_name: 'rbd'
    }
  ];

  configureTestBed(
    {
      declarations: [IscsiTargetFormComponent],
      imports: [
        SharedModule,
        ReactiveFormsModule,
        HttpClientTestingModule,
        RouterTestingModule,
        ToastrModule.forRoot()
      ],
      providers: [
        i18nProviders,
        {
          provide: ActivatedRoute,
          useValue: new ActivatedRouteStub({ target_iqn: undefined })
        }
      ]
    },
    true
  );

  beforeEach(() => {
    fixture = TestBed.createComponent(IscsiTargetFormComponent);
    component = fixture.componentInstance;
    httpTesting = TestBed.get(HttpTestingController);
github frangoteam / FUXA / client / src / app / app.module.ts View on Github external
NgxDygraphsComponent,
    ChartConfigComponent,
    DialogListItem
  ],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    routing,
    MaterialModule,
    BrowserAnimationsModule,
    ColorPickerModule,
    Ng5SliderModule,
    MatSelectSearchModule,
    ToastrModule.forRoot({
      timeOut: 3000,
      positionClass: "toast-bottom-right",
      preventDuplicates: false
    }),
    DndModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: createTranslateLoader,
        deps: [HttpClient]
      }
    })
  ],
  providers: [
    HmiService,
    ProjectService,
github fischermatte / geolud / geolud-client / projects / geolud-client / app / chat / chat.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ChatComponent],
      imports: [FormsModule, ToastrModule.forRoot(), BrowserAnimationsModule],
    }).compileComponents();
  }));

ngx-toastr

Toastr for Angular

MIT
Latest version published 7 months ago

Package Health Score

73 / 100
Full package analysis