diff options
Diffstat (limited to 'ufund-ui/src/app/components/funding-basket')
| -rw-r--r-- | ufund-ui/src/app/components/funding-basket/funding-basket.component.ts | 16 | 
1 files changed, 14 insertions, 2 deletions
diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts index 8b12306..c44aa27 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts @@ -1,4 +1,6 @@ -import { Component } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {Router} from '@angular/router'; +import {UsersService} from '../../services/users.service';  @Component({    selector: 'app-funding-basket', @@ -6,6 +8,16 @@ import { Component } from '@angular/core';    templateUrl: './funding-basket.component.html',    styleUrl: './funding-basket.component.css'  }) -export class FundingBasketComponent { +export class FundingBasketComponent implements OnInit{ +    constructor( +       private router: Router, +       private userService: UsersService +    ) {} + +    ngOnInit() { +        if (!this.userService.getCurrentUser()) { +            this.router.navigate(['/login'], {queryParams: {redir: this.router.url}}) +        } +    }  }  | 
