import {Component, EventEmitter, Input, Output} from "@angular/core"; import {RouterHelper} from "../../utils/routerHelper.class"; import {properties} from "../../../../environments/environment"; import {StringUtils} from "../../utils/string-utils.class"; @Component({ selector: 'sdg', template: `
Beta
{{title}} {{title}} ({{subjects.length}}) View all View all & suggest Suggest
sdg_colors
Beta
sdg_colors SDGs:
View all
` }) export class SdgComponent { @Input() subjects: string[]; @Input() viewAll: boolean = false; @Output() viewAllClicked = new EventEmitter(); @Output() suggestClicked = new EventEmitter(); public lessBtn: boolean = false; public threshold: number = 2; public routerHelper: RouterHelper = new RouterHelper(); public properties = properties; public title: string = "SDGs"; public viewAllClick() { // if(this.subjects.length <= this.threshold*2) { // this.viewAll = true; // this.lessBtn = true; // } else { this.viewAll = true; this.viewAllClicked.emit('sdg'); // } } public viewLessClick() { this.viewAll = false; this.viewAllClicked.emit(""); } public suggestClick() { this.suggestClicked.emit('sdg'); } public urlEncodeAndQuote(str: string): string { return StringUtils.quote(StringUtils.URIEncode(str)); } }