@@ -4,8 +4,9 @@ import {Meta, Title} from '@angular/platform-browser';
44
55import { NavigationEnd , Router } from '@angular/router' ;
66import { AppConfig } from './config/app.config' ;
7- import { UtilsService } from './shared/services/utils.service ' ;
7+ import { MatSnackBar } from '@angular/material ' ;
88
9+ declare const Modernizr ;
910
1011@Component ( {
1112 selector : 'app-root' ,
@@ -17,7 +18,7 @@ export class AppComponent {
1718 constructor ( private translateService : TranslateService ,
1819 private title : Title ,
1920 private meta : Meta ,
20- private utilsService : UtilsService ,
21+ private snackBar : MatSnackBar ,
2122 private router : Router ) {
2223
2324 this . translateService = translateService ;
@@ -45,8 +46,25 @@ export class AppComponent {
4546 }
4647 } ) ;
4748
48- this . utilsService . checkBrowserFeatures ( ) ;
49+ this . checkBrowserFeatures ( ) ;
4950 }
5051
52+ checkBrowserFeatures ( ) {
53+ let supported = true ;
54+ for ( let feature in Modernizr ) {
55+ if ( Modernizr . hasOwnProperty ( feature ) &&
56+ typeof Modernizr [ feature ] === 'boolean' && Modernizr [ feature ] === false ) {
57+ supported = false ;
58+ break ;
59+ }
60+ }
61+
62+ if ( ! supported ) {
63+ this . translateService . get ( [ 'updateBrowser' ] ) . subscribe ( ( texts ) => {
64+ this . snackBar . open ( texts [ 'updateBrowser' ] , 'OK' ) ;
65+ } ) ;
66+ }
5167
68+ return supported ;
69+ }
5270}
0 commit comments