import {Component, EventEmitter, Input, Output} from "@angular/core"; import {RouterHelper} from "../../utils/routerHelper.class"; import {properties} from "../../../../environments/environment"; @Component({ selector: 'fos', template: `
` }) export class FosComponent { @Input() subjects: string[]; @Input() viewAll: boolean = false; @Output() viewAllClicked = new EventEmitter(); public lessBtn: boolean = false; public threshold: number = 2; public routerHelper: RouterHelper = new RouterHelper(); public properties = properties; public title: string = "Fields of Science (FOS)"; public viewAllClick() { if(this.subjects.length <= this.threshold*2) { this.viewAll = true; this.lessBtn = true; } else { this.viewAll = true; this.viewAllClicked.emit('fos'); } } public viewLessClick() { this.viewAll = false; this.viewAllClicked.emit(""); } }