argos/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.ts

42 lines
1.0 KiB
TypeScript
Raw Normal View History

2017-12-14 17:43:57 +01:00
import { Component, OnInit, Input } from '@angular/core';
2017-12-20 15:11:41 +01:00
import { Router } from '@angular/router';
2018-08-27 17:09:33 +02:00
import { AuthService } from '../../../services/auth/auth.service';
2017-12-14 17:43:57 +01:00
@Component({
selector: 'app-figurecard',
templateUrl: './figurecard.component.html',
2018-08-30 13:09:36 +02:00
styleUrls: ['./figurecard.component.scss']
2017-12-14 17:43:57 +01:00
})
export class FigurecardComponent implements OnInit {
@Input() headerIcon: string;
@Input() category: string;
@Input() title: string;
@Input() footerIcon: string;
@Input() footContent: string;
@Input() linearColor: string;
@Input() boxShadow: string;
@Input() routelLink: string;
@Input() hasFootContent = true;
2018-08-24 17:21:02 +02:00
@Input() buttonTitle: string;
@Input() buttonRedirectLink: string;
2017-12-20 15:11:41 +01:00
constructor(private router: Router, private authService: AuthService) { }
2017-12-14 17:43:57 +01:00
ngOnInit() {
}
2017-12-14 17:43:57 +01:00
navigateToUrl() {
if (!this.isAuthenticated()) { return; }
this.router.navigate([this.routelLink]);
}
2017-12-20 15:11:41 +01:00
createNew() {
this.router.navigate([this.buttonRedirectLink]);
}
2017-12-20 15:11:41 +01:00
isAuthenticated() {
return this.authService.current() != null;
}
2018-08-27 17:09:33 +02:00
2017-12-14 17:43:57 +01:00
}