### File

`src/app/shared/guard/auth.guard.ts`

### Index

###### Methods
canActivate

### Constructor

`constructor(router: Router)`
Defined in src/app/shared/guard/auth.guard.ts:6
Parameters :
Name | Type | Optional | Description
router | `Router` |  |

### Methods

canActivate
`canActivate()`
Defined in src/app/shared/guard/auth.guard.ts:10
Returns : `boolean`

    import { Injectable } from '@angular/core';
    import { CanActivate } from '@angular/router';
    import { Router } from '@angular/router';

    @Injectable()
    export class AuthGuard implements CanActivate {

        constructor(private router: Router) { }

        canActivate() {
            if (localStorage.getItem('isLoggedin')) {
                return true;

            }

            this.router.navigate(['/login1']);
            return false;
        }

    }

# results matching ""

# No results matching ""