You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
argos/dmp-frontend/src/app/shared/components/figurecard/figurecard.component.ts

42 lines
1.0 KiB
TypeScript

import { Component, OnInit, Input } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from '../../../services/auth/auth.service';
@Component({
selector: 'app-figurecard',
templateUrl: './figurecard.component.html',
styleUrls: ['./figurecard.component.scss']
})
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;
@Input() buttonTitle: string;
@Input() buttonRedirectLink: string;
constructor(private router: Router, private authService: AuthService) { }
ngOnInit() {
}
navigateToUrl() {
if (!this.isAuthenticated()) { return; }
this.router.navigate([this.routelLink]);
}
createNew() {
this.router.navigate([this.buttonRedirectLink]);
}
isAuthenticated() {
return this.authService.current() != null;
}
}