Prettied, Linted and updated angular.json according to the latest schematic of Angular CLI.

Now all that is needed is to make it ready for strict compiling.
Removed eslint-plugin-prettier as it is not recommended and causes errors for both eslint and prettier

Bumped to v8.0.0
This commit is contained in:
tanshu committed 2020-10-10 08:45:05 +05:30
1 parent 438a98334d
commit 5ea09df272
320 files changed
+2233 -2268

No files matched your search

+6 -5
View File
@@ -1,9 +1,10 @@
import { Injectable } from '@angular/core';
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { AuthService } from './auth.service';
import { ToasterService } from '../core/toaster.service';
import { AuthService } from './auth.service';
@Injectable({ providedIn: 'root' })
export class AuthGuard implements CanActivate {
constructor(
@@ -13,11 +14,11 @@ export class AuthGuard implements CanActivate {
) {}
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
const user = this.authService.user;
const { user } = this.authService;
const permission =
route.data['permission'] === undefined
? route.data['permission']
: route.data['permission'].replace(/ /g, '-').toLowerCase();
route.data.permission === undefined
? route.data.permission
: route.data.permission.replace(/ /g, '-').toLowerCase();
if (!user) {
// not logged in so redirect to login page with the return url
this.router.navigate(['/login'], { queryParams: { returnUrl: state.url } });