Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 325116f

Browse files
ngx-toastr added
1 parent d0f3f79 commit 325116f

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

‎src/AspnetRun.Web/package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/AspnetRun.Web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"ng-wizard": "^1.0.0",
3636
"ngx-bootstrap": "^4.3.0",
3737
"ngx-perfect-scrollbar": "^7.2.1",
38+
"ngx-toastr": "^11.1.0",
3839
"ngx-ui-loader": "^7.2.2",
3940
"rxjs": "^6.5.3",
4041
"simple-line-icons": "^2.4.1",

‎src/AspnetRun.Web/src/app/core/core.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
1818
import { TabsModule } from 'ngx-bootstrap/tabs';
1919
import { RouterModule } from '@angular/router';
2020
import { CustomerDataService } from './services/customer-data.services';
21+
import { ToastrModule } from 'ngx-toastr';
2122

2223
const APP_CONTAINERS = [LayoutComponent];
2324

@@ -30,6 +31,7 @@ const APP_CONTAINERS = [LayoutComponent];
3031
NgxUiLoaderModule,
3132
//NgxUiLoaderRouterModule, // import this module for showing loader automatically when navigating between app routes
3233
NgxUiLoaderHttpModule.forRoot({ showForeground: false }),
34+
ToastrModule.forRoot({ positionClass: 'toast-top-full-width', closeButton: true }),
3335
AppAsideModule,
3436
AppBreadcrumbModule.forRoot(),
3537
AppFooterModule,

‎src/AspnetRun.Web/src/app/core/interceptors/http-error.interceptor.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest, HttpErrorResponse
22
import { Observable, empty } from 'rxjs';
33
import { catchError } from 'rxjs/operators';
44
import { environment } from 'src/environments/environment';
5+
import { Injectable } from '@angular/core';
6+
import { ToastrService } from 'ngx-toastr';
57

8+
@Injectable()
69
export class HttpErrorInterceptor implements HttpInterceptor {
10+
constructor(private toastr: ToastrService) {
11+
}
12+
713
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
814
return next.handle(request)
915
.pipe(
@@ -23,7 +29,7 @@ export class HttpErrorInterceptor implements HttpInterceptor {
2329
console.log(error);
2430
}
2531

26-
//TODO: a popup will be shown
32+
this.toastr.error(errorMessage);
2733
console.log(errorMessage);
2834

2935
return empty();

‎src/AspnetRun.Web/src/styles.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
@import '~ng-wizard/themes/ng_wizard_theme_arrows.min.css';
99
@import '~ng-wizard/themes/ng_wizard_theme_circles.min.css';
1010
@import '~ng-wizard/themes/ng_wizard_theme_dots.min.css';
11+
12+
@import '~ngx-toastr/toastr-bs4-alert';

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /