How to use the ngx-toastr.ToastrService 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 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 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 / about.component.js View on Github external
}
            else {
                _this.showError('Delete', "An error occurred");
            }
        }, function (error) {
            _this.showError('Delete', JSON.stringify(error));
        });
    };
    return AboutComponent;
}());
AboutComponent = __decorate([
    core_1.Component({
        selector: 'my-about',
        templateUrl: 'partial/aboutComponent'
    }),
    __metadata("design:paramtypes", [sampleData_service_1.SampleDataService, ngx_toastr_1.ToastrService])
], AboutComponent);
exports.AboutComponent = AboutComponent;
//# sourceMappingURL=about.component.js.map
github RobertDyball / A2SPA / VS2017_2 / A2SPA / wwwroot / app / about.component.js View on Github external
}
            else {
                _this.showError('Delete', status.value);
            }
        }, function (error) {
            _this.showError('Delete', JSON.stringify(error));
        });
    };
    return AboutComponent;
}());
AboutComponent = __decorate([
    core_1.Component({
        selector: 'my-about',
        templateUrl: '/partial/aboutComponent'
    }),
    __metadata("design:paramtypes", [SampleDataService_1.SampleDataService, ngx_toastr_1.ToastrService])
], AboutComponent);
exports.AboutComponent = AboutComponent;
//# sourceMappingURL=about.component.js.map
github RobertDyball / A2SPA / VS2017 / A2SPA / wwwroot / app / about.component.js View on Github external
}
            else {
                _this.showError('Delete', "An error occurred");
            }
        }, function (error) {
            _this.showError('Delete', JSON.stringify(error));
        });
    };
    return AboutComponent;
}());
AboutComponent = __decorate([
    core_1.Component({
        selector: 'my-about',
        templateUrl: 'partial/aboutComponent'
    }),
    __metadata("design:paramtypes", [sampleData_service_1.SampleDataService, ngx_toastr_1.ToastrService])
], AboutComponent);
exports.AboutComponent = AboutComponent;
//# sourceMappingURL=about.component.js.map
github RobertDyball / A2SPA / VS2017_2 / A2SPA / wwwroot / app / services / ErrorMessageService.js View on Github external
if (i < error.length)
                errorMessage += ", ";
        }
        return errorMessage;
    };
    ErrorMessageService.prototype.showSuccess = function (title, message) {
        this.toastrService.success(message, title);
    };
    ErrorMessageService.prototype.showError = function (title, message) {
        this.toastrService.error(message, title);
    };
    return ErrorMessageService;
}());
ErrorMessageService = __decorate([
    core_1.Injectable(),
    __metadata("design:paramtypes", [ngx_toastr_1.ToastrService])
], ErrorMessageService);
exports.ErrorMessageService = ErrorMessageService;
//# sourceMappingURL=ErrorMessageService.js.map

ngx-toastr

Toastr for Angular

MIT
Latest version published 6 months ago

Package Health Score

80 / 100
Full package analysis