Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"styles": [
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/toastr/build/toastr.min.css",
"src/app/styles/main.styles.scss"
],
"scripts": []
Expand Down Expand Up @@ -86,6 +87,7 @@
"styles": [
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/toastr/build/toastr.min.css",
"src/app/styles/main.styles.scss"
],
"scripts": []
Expand All @@ -101,6 +103,7 @@
}
},
"cli": {
"schematicCollections": ["@angular-eslint/schematics"]
"schematicCollections": ["@angular-eslint/schematics"],
"analytics": "e88575e8-9f3c-4b9e-aa62-0f021be21cff"
}
}
34 changes: 34 additions & 0 deletions src/app/shared/services/toastr.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* eslint-disable class-methods-use-this */
import { Injectable } from '@angular/core';
import toastr from 'toastr';

@Injectable({
providedIn: 'root',
})
export class ToastrService {
constructor() {
// You can configure toastr options here if needed
toastr.options = {
closeButton: true,
progressBar: true,
timeOut: 3000,
positionClass: 'toast-top-right',
};
}

success(message: string, title?: string) {
toastr.success(message, title);
}

error(message: string, title?: string) {
toastr.error(message, title);
}

info(message: string, title?: string) {
toastr.info(message, title);
}

warning(message: string, title?: string) {
toastr.warning(message, title);
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"allowSyntheticDefaultImports": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
Expand Down