|
@@ -1,144 +1,103 @@
|
|
|
import { environment } from 'src/environments/environment';
|
|
import { environment } from 'src/environments/environment';
|
|
|
import { User } from './../models/userResponse';
|
|
import { User } from './../models/userResponse';
|
|
|
import { Token, payloadToken } from './../models/token';
|
|
import { Token, payloadToken } from './../models/token';
|
|
|
-import { Injectable } from '@angular/core';
|
|
|
|
|
-import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
|
|
|
-import { BehaviorSubject, Observable, throwError } from 'rxjs';
|
|
|
|
|
|
|
+import { Injectable, Inject, PLATFORM_ID } from '@angular/core';
|
|
|
|
|
+import { HttpClient } from '@angular/common/http';
|
|
|
|
|
+import { BehaviorSubject, Observable } from 'rxjs';
|
|
|
import { Router } from '@angular/router';
|
|
import { Router } from '@angular/router';
|
|
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
|
-import { AlertMessageComponent } from 'src/app/components/shared/alert-message/alert-message.component'
|
|
|
|
|
-import { catchError, map, tap } from 'rxjs/operators';
|
|
|
|
|
|
|
+import { AlertMessageComponent } from 'src/app/components/shared/alert-message/alert-message.component';
|
|
|
|
|
+import { map, tap } from 'rxjs/operators';
|
|
|
import * as jwt_decode from 'jwt-decode';
|
|
import * as jwt_decode from 'jwt-decode';
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+import { isPlatformBrowser } from '@angular/common';
|
|
|
|
|
+import { StorageService } from 'src/app/services/storage.service'; // Assurez-vous de créer ce service
|
|
|
|
|
|
|
|
@Injectable({
|
|
@Injectable({
|
|
|
providedIn: 'root'
|
|
providedIn: 'root'
|
|
|
})
|
|
})
|
|
|
export class AuthService {
|
|
export class AuthService {
|
|
|
-
|
|
|
|
|
- //url api
|
|
|
|
|
- private apiUrl = environment.apiUrl
|
|
|
|
|
-
|
|
|
|
|
|
|
+ private apiUrl = environment.apiUrl;
|
|
|
private currentUserSubject: BehaviorSubject<User> = new BehaviorSubject<User>(null);
|
|
private currentUserSubject: BehaviorSubject<User> = new BehaviorSubject<User>(null);
|
|
|
public currentUser: Observable<User> = this.currentUserSubject.asObservable();
|
|
public currentUser: Observable<User> = this.currentUserSubject.asObservable();
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
private tokenSubject: BehaviorSubject<Token>;
|
|
private tokenSubject: BehaviorSubject<Token>;
|
|
|
public token: Observable<Token>;
|
|
public token: Observable<Token>;
|
|
|
-
|
|
|
|
|
private user_infoSubject: BehaviorSubject<User>;
|
|
private user_infoSubject: BehaviorSubject<User>;
|
|
|
public user_info: Observable<User>;
|
|
public user_info: Observable<User>;
|
|
|
-
|
|
|
|
|
private messageSource = new BehaviorSubject('default message');
|
|
private messageSource = new BehaviorSubject('default message');
|
|
|
currentMessage = this.messageSource.asObservable();
|
|
currentMessage = this.messageSource.asObservable();
|
|
|
|
|
|
|
|
- constructor(private http: HttpClient, public router: Router, public snackBar: MatSnackBar) {
|
|
|
|
|
-
|
|
|
|
|
- this.tokenSubject = new BehaviorSubject<Token>(JSON.parse(localStorage.getItem('token')));
|
|
|
|
|
|
|
+ constructor(
|
|
|
|
|
+ private http: HttpClient,
|
|
|
|
|
+ public router: Router,
|
|
|
|
|
+ public snackBar: MatSnackBar,
|
|
|
|
|
+ private storageService: StorageService,
|
|
|
|
|
+ @Inject(PLATFORM_ID) private platformId: Object
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.tokenSubject = new BehaviorSubject<Token>(JSON.parse(this.storageService.getItem('token')));
|
|
|
this.token = this.tokenSubject.asObservable();
|
|
this.token = this.tokenSubject.asObservable();
|
|
|
-
|
|
|
|
|
- this.user_infoSubject = new BehaviorSubject<User>(JSON.parse(localStorage.getItem('user')));
|
|
|
|
|
|
|
+ this.user_infoSubject = new BehaviorSubject<User>(JSON.parse(this.storageService.getItem('user')));
|
|
|
this.user_info = this.user_infoSubject.asObservable();
|
|
this.user_info = this.user_infoSubject.asObservable();
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
changeMessage(message: string) {
|
|
changeMessage(message: string) {
|
|
|
- this.messageSource.next(message)
|
|
|
|
|
|
|
+ this.messageSource.next(message);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //get token
|
|
|
|
|
public get tokenValue(): Token {
|
|
public get tokenValue(): Token {
|
|
|
return this.tokenSubject.value;
|
|
return this.tokenSubject.value;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //get user Info
|
|
|
|
|
public get userValue(): User {
|
|
public get userValue(): User {
|
|
|
return this.user_infoSubject.value;
|
|
return this.user_infoSubject.value;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // login get token on login
|
|
|
|
|
signIn(credentials): Observable<Token> {
|
|
signIn(credentials): Observable<Token> {
|
|
|
- //debugger;
|
|
|
|
|
- console.log("url ========",this.apiUrl);
|
|
|
|
|
-
|
|
|
|
|
return this.http.post<Token>(`${this.apiUrl}/api/auth/login`, credentials)
|
|
return this.http.post<Token>(`${this.apiUrl}/api/auth/login`, credentials)
|
|
|
.pipe(map(token => {
|
|
.pipe(map(token => {
|
|
|
- // store jwt token in local storage
|
|
|
|
|
- localStorage.setItem('token', JSON.stringify(token));
|
|
|
|
|
|
|
+ this.storageService.setItem('token', JSON.stringify(token));
|
|
|
this.tokenSubject.next(token);
|
|
this.tokenSubject.next(token);
|
|
|
return token;
|
|
return token;
|
|
|
}));
|
|
}));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- // Méthode pour s'authentifier avec Google
|
|
|
|
|
signInWithGoogle(): Observable<User> {
|
|
signInWithGoogle(): Observable<User> {
|
|
|
return this.http.get<User>(`${this.apiUrl}/api/auth/google`).pipe(
|
|
return this.http.get<User>(`${this.apiUrl}/api/auth/google`).pipe(
|
|
|
map(user => {
|
|
map(user => {
|
|
|
- console.log('je suis present', user )
|
|
|
|
|
- localStorage.setItem('user', JSON.stringify(user));
|
|
|
|
|
|
|
+ console.log('je suis present', user);
|
|
|
|
|
+ this.storageService.setItem('user', JSON.stringify(user));
|
|
|
return user;
|
|
return user;
|
|
|
})
|
|
})
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // signInWithGoogle(): Observable<string> {
|
|
|
|
|
- // return this.http.get<any>(`${this.apiUrl}/api/auth/google/callback`).pipe(
|
|
|
|
|
- // map(response => response.token),
|
|
|
|
|
- // catchError(error => {
|
|
|
|
|
- // console.log(error);
|
|
|
|
|
- // // Gérer l'erreur
|
|
|
|
|
- // throw error;
|
|
|
|
|
- // })
|
|
|
|
|
- // );
|
|
|
|
|
- // }
|
|
|
|
|
- // login get token on login admin
|
|
|
|
|
- signInAdmin(credentials): Observable<Token> {
|
|
|
|
|
- //debugger;
|
|
|
|
|
- console.log("url ========",this.apiUrl);
|
|
|
|
|
-
|
|
|
|
|
- return this.http.post<Token>(`${this.apiUrl}/api/auth/admin`, credentials)
|
|
|
|
|
- .pipe(map(token => {
|
|
|
|
|
- // store jwt token in local storage
|
|
|
|
|
- localStorage.setItem('token', JSON.stringify(token));
|
|
|
|
|
- this.tokenSubject.next(token);
|
|
|
|
|
- return token;
|
|
|
|
|
- }));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
+ signInAdmin(credentials): Observable<Token> {
|
|
|
|
|
+ return this.http.post<Token>(`${this.apiUrl}/api/auth/admin`, credentials)
|
|
|
|
|
+ .pipe(map(token => {
|
|
|
|
|
+ this.storageService.setItem('token', JSON.stringify(token));
|
|
|
|
|
+ this.tokenSubject.next(token);
|
|
|
|
|
+ return token;
|
|
|
|
|
+ }));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // iscription get token on login
|
|
|
|
|
signUP(data): Observable<Token> {
|
|
signUP(data): Observable<Token> {
|
|
|
-
|
|
|
|
|
return this.http.post<Token>(`${this.apiUrl}/api/auth/signup`, data)
|
|
return this.http.post<Token>(`${this.apiUrl}/api/auth/signup`, data)
|
|
|
.pipe(map(token => {
|
|
.pipe(map(token => {
|
|
|
- // store jwt token in local storage
|
|
|
|
|
- localStorage.setItem('token', JSON.stringify(token));
|
|
|
|
|
|
|
+ this.storageService.setItem('token', JSON.stringify(token));
|
|
|
this.tokenSubject.next(token);
|
|
this.tokenSubject.next(token);
|
|
|
return token;
|
|
return token;
|
|
|
}));
|
|
}));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ lostPassword(email): Observable<any> {
|
|
|
|
|
+ return this.http.put<any>(`${this.apiUrl}/api/auth/forgot-password`, email);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ resetPassword(data): Observable<any> {
|
|
|
|
|
+ return this.http.put<any>(`${this.apiUrl}/api/auth/reset-password`, data);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-// mot de passe oublie
|
|
|
|
|
-lostPassword(email): Observable<any> {
|
|
|
|
|
- return this.http.put<any>(`${this.apiUrl}/api/auth/forgot-password`, email)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-// réinitialiser mot de passe
|
|
|
|
|
-resetPassword(data): Observable<any> {
|
|
|
|
|
- return this.http.put<any>(`${this.apiUrl}/api/auth/reset-password`, data)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
- // isLoggedIn
|
|
|
|
|
public isLoggedIn() {
|
|
public isLoggedIn() {
|
|
|
- return localStorage.getItem('token') !== null;
|
|
|
|
|
|
|
+ return this.storageService.getItem('token') !== null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
getCurrentUser(): Observable<User> {
|
|
getCurrentUser(): Observable<User> {
|
|
@@ -149,34 +108,28 @@ resetPassword(data): Observable<any> {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //logout
|
|
|
|
|
public logout() {
|
|
public logout() {
|
|
|
- // remove token from local storage
|
|
|
|
|
- localStorage.removeItem('token');
|
|
|
|
|
|
|
+ this.storageService.removeItem('token');
|
|
|
this.tokenSubject.next(null);
|
|
this.tokenSubject.next(null);
|
|
|
- // remove user from local storage
|
|
|
|
|
- localStorage.removeItem('user');
|
|
|
|
|
|
|
+ this.storageService.removeItem('user');
|
|
|
this.user_infoSubject.next(null);
|
|
this.user_infoSubject.next(null);
|
|
|
this.router.navigate(['/login']);
|
|
this.router.navigate(['/login']);
|
|
|
- setTimeout(() => {
|
|
|
|
|
- document.location.reload()
|
|
|
|
|
- },1000)
|
|
|
|
|
|
|
+ if (isPlatformBrowser(this.platformId)) {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ document.location.reload();
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // get info user
|
|
|
|
|
- getUserInfo(): Observable<User> {
|
|
|
|
|
-
|
|
|
|
|
- let decodedToken : payloadToken = jwt_decode(this.tokenSubject.value.token);
|
|
|
|
|
|
|
+ getUserInfo(): Observable<User> {
|
|
|
|
|
+ let decodedToken: payloadToken = jwt_decode(this.tokenSubject.value.token);
|
|
|
return this.http.get<User>(`${this.apiUrl}/api/users/${decodedToken.userId}`)
|
|
return this.http.get<User>(`${this.apiUrl}/api/users/${decodedToken.userId}`)
|
|
|
.pipe(map(user => {
|
|
.pipe(map(user => {
|
|
|
- // store user info in local storage
|
|
|
|
|
- localStorage.setItem('user', JSON.stringify(user));
|
|
|
|
|
|
|
+ this.storageService.setItem('user', JSON.stringify(user));
|
|
|
this.user_infoSubject.next(user);
|
|
this.user_infoSubject.next(user);
|
|
|
return user;
|
|
return user;
|
|
|
}));
|
|
}));
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
openSnackBar(message: string) {
|
|
openSnackBar(message: string) {
|
|
|
this.snackBar.openFromComponent(AlertMessageComponent, {
|
|
this.snackBar.openFromComponent(AlertMessageComponent, {
|
|
@@ -185,6 +138,196 @@ resetPassword(data): Observable<any> {
|
|
|
duration: 10000
|
|
duration: 10000
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// import { environment } from 'src/environments/environment';
|
|
|
|
|
+// import { User } from './../models/userResponse';
|
|
|
|
|
+// import { Token, payloadToken } from './../models/token';
|
|
|
|
|
+// import { Injectable } from '@angular/core';
|
|
|
|
|
+// import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
|
|
|
+// import { BehaviorSubject, Observable, throwError } from 'rxjs';
|
|
|
|
|
+// import { Router } from '@angular/router';
|
|
|
|
|
+// import { MatSnackBar } from '@angular/material/snack-bar';
|
|
|
|
|
+// import { AlertMessageComponent } from 'src/app/components/shared/alert-message/alert-message.component'
|
|
|
|
|
+// import { catchError, map, tap } from 'rxjs/operators';
|
|
|
|
|
+// import * as jwt_decode from 'jwt-decode';
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// @Injectable({
|
|
|
|
|
+// providedIn: 'root'
|
|
|
|
|
+// })
|
|
|
|
|
+// export class AuthService {
|
|
|
|
|
+
|
|
|
|
|
+// //url api
|
|
|
|
|
+// private apiUrl = environment.apiUrl
|
|
|
|
|
+
|
|
|
|
|
+// private currentUserSubject: BehaviorSubject<User> = new BehaviorSubject<User>(null);
|
|
|
|
|
+// public currentUser: Observable<User> = this.currentUserSubject.asObservable();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// private tokenSubject: BehaviorSubject<Token>;
|
|
|
|
|
+// public token: Observable<Token>;
|
|
|
|
|
+
|
|
|
|
|
+// private user_infoSubject: BehaviorSubject<User>;
|
|
|
|
|
+// public user_info: Observable<User>;
|
|
|
|
|
+
|
|
|
|
|
+// private messageSource = new BehaviorSubject('default message');
|
|
|
|
|
+// currentMessage = this.messageSource.asObservable();
|
|
|
|
|
+
|
|
|
|
|
+// constructor(private http: HttpClient, public router: Router, public snackBar: MatSnackBar) {
|
|
|
|
|
+
|
|
|
|
|
+// this.tokenSubject = new BehaviorSubject<Token>(JSON.parse(localStorage.getItem('token')));
|
|
|
|
|
+// this.token = this.tokenSubject.asObservable();
|
|
|
|
|
+
|
|
|
|
|
+// this.user_infoSubject = new BehaviorSubject<User>(JSON.parse(localStorage.getItem('user')));
|
|
|
|
|
+// this.user_info = this.user_infoSubject.asObservable();
|
|
|
|
|
+
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// changeMessage(message: string) {
|
|
|
|
|
+// this.messageSource.next(message)
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// //get token
|
|
|
|
|
+// public get tokenValue(): Token {
|
|
|
|
|
+// return this.tokenSubject.value;
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// //get user Info
|
|
|
|
|
+// public get userValue(): User {
|
|
|
|
|
+// return this.user_infoSubject.value;
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// // login get token on login
|
|
|
|
|
+// signIn(credentials): Observable<Token> {
|
|
|
|
|
+// //debugger;
|
|
|
|
|
+// console.log("url ========",this.apiUrl);
|
|
|
|
|
+
|
|
|
|
|
+// return this.http.post<Token>(`${this.apiUrl}/api/auth/login`, credentials)
|
|
|
|
|
+// .pipe(map(token => {
|
|
|
|
|
+// // store jwt token in local storage
|
|
|
|
|
+// localStorage.setItem('token', JSON.stringify(token));
|
|
|
|
|
+// this.tokenSubject.next(token);
|
|
|
|
|
+// return token;
|
|
|
|
|
+// }));
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// // Méthode pour s'authentifier avec Google
|
|
|
|
|
+// signInWithGoogle(): Observable<User> {
|
|
|
|
|
+// return this.http.get<User>(`${this.apiUrl}/api/auth/google`).pipe(
|
|
|
|
|
+// map(user => {
|
|
|
|
|
+// console.log('je suis present', user )
|
|
|
|
|
+// localStorage.setItem('user', JSON.stringify(user));
|
|
|
|
|
+// return user;
|
|
|
|
|
+// })
|
|
|
|
|
+// );
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// // signInWithGoogle(): Observable<string> {
|
|
|
|
|
+// // return this.http.get<any>(`${this.apiUrl}/api/auth/google/callback`).pipe(
|
|
|
|
|
+// // map(response => response.token),
|
|
|
|
|
+// // catchError(error => {
|
|
|
|
|
+// // console.log(error);
|
|
|
|
|
+// // // Gérer l'erreur
|
|
|
|
|
+// // throw error;
|
|
|
|
|
+// // })
|
|
|
|
|
+// // );
|
|
|
|
|
+// // }
|
|
|
|
|
+// // login get token on login admin
|
|
|
|
|
+// signInAdmin(credentials): Observable<Token> {
|
|
|
|
|
+// //debugger;
|
|
|
|
|
+// console.log("url ========",this.apiUrl);
|
|
|
|
|
+
|
|
|
|
|
+// return this.http.post<Token>(`${this.apiUrl}/api/auth/admin`, credentials)
|
|
|
|
|
+// .pipe(map(token => {
|
|
|
|
|
+// // store jwt token in local storage
|
|
|
|
|
+// localStorage.setItem('token', JSON.stringify(token));
|
|
|
|
|
+// this.tokenSubject.next(token);
|
|
|
|
|
+// return token;
|
|
|
|
|
+// }));
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// // iscription get token on login
|
|
|
|
|
+// signUP(data): Observable<Token> {
|
|
|
|
|
+
|
|
|
|
|
+// return this.http.post<Token>(`${this.apiUrl}/api/auth/signup`, data)
|
|
|
|
|
+// .pipe(map(token => {
|
|
|
|
|
+// // store jwt token in local storage
|
|
|
|
|
+// localStorage.setItem('token', JSON.stringify(token));
|
|
|
|
|
+// this.tokenSubject.next(token);
|
|
|
|
|
+// return token;
|
|
|
|
|
+// }));
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// // mot de passe oublie
|
|
|
|
|
+// lostPassword(email): Observable<any> {
|
|
|
|
|
+// return this.http.put<any>(`${this.apiUrl}/api/auth/forgot-password`, email)
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// // réinitialiser mot de passe
|
|
|
|
|
+// resetPassword(data): Observable<any> {
|
|
|
|
|
+// return this.http.put<any>(`${this.apiUrl}/api/auth/reset-password`, data)
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// // isLoggedIn
|
|
|
|
|
+// public isLoggedIn() {
|
|
|
|
|
+// return localStorage.getItem('token') !== null;
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// getCurrentUser(): Observable<User> {
|
|
|
|
|
+// return this.http.get<User>('/api/auth/user').pipe(
|
|
|
|
|
+// tap((user) => {
|
|
|
|
|
+// this.currentUserSubject.next(user);
|
|
|
|
|
+// })
|
|
|
|
|
+// );
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// //logout
|
|
|
|
|
+// public logout() {
|
|
|
|
|
+// // remove token from local storage
|
|
|
|
|
+// localStorage.removeItem('token');
|
|
|
|
|
+// this.tokenSubject.next(null);
|
|
|
|
|
+// // remove user from local storage
|
|
|
|
|
+// localStorage.removeItem('user');
|
|
|
|
|
+// this.user_infoSubject.next(null);
|
|
|
|
|
+// this.router.navigate(['/login']);
|
|
|
|
|
+// setTimeout(() => {
|
|
|
|
|
+// document.location.reload()
|
|
|
|
|
+// },1000)
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// // get info user
|
|
|
|
|
+// getUserInfo(): Observable<User> {
|
|
|
|
|
+
|
|
|
|
|
+// let decodedToken : payloadToken = jwt_decode(this.tokenSubject.value.token);
|
|
|
|
|
+// return this.http.get<User>(`${this.apiUrl}/api/users/${decodedToken.userId}`)
|
|
|
|
|
+// .pipe(map(user => {
|
|
|
|
|
+// // store user info in local storage
|
|
|
|
|
+// localStorage.setItem('user', JSON.stringify(user));
|
|
|
|
|
+// this.user_infoSubject.next(user);
|
|
|
|
|
+// return user;
|
|
|
|
|
+// }));
|
|
|
|
|
+
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// openSnackBar(message: string) {
|
|
|
|
|
+// this.snackBar.openFromComponent(AlertMessageComponent, {
|
|
|
|
|
+// data: message,
|
|
|
|
|
+// panelClass: ['blue-snackbar'],
|
|
|
|
|
+// duration: 10000
|
|
|
|
|
+// });
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// }
|