How to use ngx-toastr - 10 common examples

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 RobertDyball / A2SPA / VS2017 / A2SPA / wwwroot / app / changePassword.component.js View on Github external
}
        }, function (error) {
            // TODO: parse error messages, generate toast popups
            // {"Email":["The Email field is required.","The Email field is not a valid e-mail address."],"Password":["The Password field is required.","The Password must be at least 6 characters long."]}
            alert(error.text());
            console.log(error.text());
        });
    };
    return ChangePasswordComponent;
}());
ChangePasswordComponent = __decorate([
    core_1.Component({
        selector: 'register',
        templateUrl: 'partial/changePasswordComponent'
    }),
    __metadata("design:paramtypes", [router_1.Router, platform_browser_1.Title, http_1.Http, auth_service_1.AuthService, ngx_toastr_1.ToastrService])
], ChangePasswordComponent);
exports.ChangePasswordComponent = ChangePasswordComponent;
//# sourceMappingURL=changePassword.component.js.map
github RobertDyball / A2SPA / VS2017_2 / A2SPA / wwwroot / app / changePassword.component.js View on Github external
}
        }, function (error) {
            // TODO: parse error messages, generate toast popups
            // {"Email":["The Email field is required.","The Email field is not a valid e-mail address."],"Password":["The Password field is required.","The Password must be at least 6 characters long."]}
            alert(error.text());
            console.log(error.text());
        });
    };
    return ChangePasswordComponent;
}());
ChangePasswordComponent = __decorate([
    core_1.Component({
        selector: 'register',
        templateUrl: 'partial/changePasswordComponent'
    }),
    __metadata("design:paramtypes", [router_1.Router, platform_browser_1.Title, http_1.Http, auth_service_1.AuthService, ngx_toastr_1.ToastrService])
], ChangePasswordComponent);
exports.ChangePasswordComponent = ChangePasswordComponent;
//# sourceMappingURL=changePassword.component.js.map
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 RobertDyball / A2SPA / VS2017_2 / A2SPA / wwwroot / app / contact.component.js View on Github external
var ContactComponent = (function () {
    // this is not meant to be secured; demonstrating a component that is open to anonymous users to access
    function ContactComponent(toastrService) {
        this.toastrService = toastrService;
    }
    ContactComponent.prototype.showSuccess = function () {
        this.toastrService.success('Hello world!', 'Toastr fun!');
    };
    return ContactComponent;
}());
ContactComponent = __decorate([
    core_1.Component({
        selector: 'my-contact',
        templateUrl: 'partial/contactComponent'
    }),
    __metadata("design:paramtypes", [ngx_toastr_1.ToastrService])
], ContactComponent);
exports.ContactComponent = ContactComponent;
//# sourceMappingURL=contact.component.js.map
github RobertDyball / A2SPA / VS2015 / src / A2SPA / wwwroot / app / contact.component.js View on Github external
var ContactComponent = (function () {
    // this is not meant to be secured; demonstrating a component that is open to anonymous users to access
    function ContactComponent(toastrService) {
        this.toastrService = toastrService;
    }
    ContactComponent.prototype.showSuccess = function () {
        this.toastrService.success('Hello world!', 'Toastr fun!');
    };
    return ContactComponent;
}());
ContactComponent = __decorate([
    core_1.Component({
        selector: 'my-contact',
        templateUrl: 'partial/contactComponent'
    }),
    __metadata("design:paramtypes", [ngx_toastr_1.ToastrService])
], ContactComponent);
exports.ContactComponent = ContactComponent;
//# sourceMappingURL=contact.component.js.map
github RobertDyball / A2SPA / VS2015 / src / A2SPA / wwwroot / app / app.module.js View on Github external
var forms_1 = require("@angular/forms");
var http_1 = require("@angular/http");
var sampleData_service_1 = require("./services/sampleData.service");
var auth_service_1 = require("./security/auth.service");
var auth_guard_service_1 = require("./security/auth-guard.service");
var ngx_toastr_1 = require("ngx-toastr");
require("./rxjs-operators");
// enableProdMode();
var AppModule = (function () {
    function AppModule() {
    }
    return AppModule;
}());
AppModule = __decorate([
    core_1.NgModule({
        imports: [animations_1.BrowserAnimationsModule, platform_browser_1.BrowserModule, forms_1.FormsModule, http_1.HttpModule, ngx_toastr_1.ToastrModule.forRoot(), app_routing_1.routing],
        declarations: [app_component_1.AppComponent, app_routing_1.routedComponents],
        providers: [sampleData_service_1.SampleDataService,
            auth_service_1.AuthService,
            auth_guard_service_1.AuthGuard, platform_browser_1.Title, { provide: common_1.APP_BASE_HREF, useValue: '/a2spa' }],
        bootstrap: [app_component_1.AppComponent]
    })
], AppModule);
exports.AppModule = AppModule;
//# sourceMappingURL=app.module.js.map
github RobertDyball / A2SPA / VS2017_2 / A2SPA / wwwroot / app / app.module.js View on Github external
var http_1 = require("@angular/http");
var ErrorMessageService_1 = require("./services/ErrorMessageService");
var sampleData_service_1 = require("./services/sampleData.service");
var auth_service_1 = require("./security/auth.service");
var auth_guard_service_1 = require("./security/auth-guard.service");
var ngx_toastr_1 = require("ngx-toastr");
require("./rxjs-operators");
// enableProdMode();
var AppModule = (function () {
    function AppModule() {
    }
    return AppModule;
}());
AppModule = __decorate([
    core_1.NgModule({
        imports: [animations_1.BrowserAnimationsModule, platform_browser_1.BrowserModule, forms_1.FormsModule, http_1.HttpModule, ngx_toastr_1.ToastrModule.forRoot(), app_routing_1.routing],
        declarations: [app_component_1.AppComponent, app_routing_1.routedComponents],
        providers: [sampleData_service_1.SampleDataService,
            ErrorMessageService_1.ErrorMessageService,
            auth_service_1.AuthService,
            auth_guard_service_1.AuthGuard, platform_browser_1.Title, { provide: common_1.APP_BASE_HREF, useValue: '/a2spa' }],
        bootstrap: [app_component_1.AppComponent]
    })
], AppModule);
exports.AppModule = AppModule;
//# sourceMappingURL=app.module.js.map
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();
  });

ngx-toastr

Toastr for Angular

MIT
Latest version published 6 months ago

Package Health Score

80 / 100
Full package analysis