import { Component , Input } from '@angular/core' ; import { FormGroup } from '@angular/forms' ; @ Component ( { selector : 'cmdb-icon-picker' , templateUrl : './icon-picker.component.html' , styleUrls : [ './icon-picker.component.scss' ] } ) export class IconPickerComponent { @ Input ( ) iconFormGroup : FormGroup ; @ Input ( ) inputDescription : string = 'Symbol for the type label' ; @ Input ( ) preSelectedIcon : string ; public fallBackIcon : string ; @ Input ( ) public set fallbackIcon ( value ) { this . fallBackIcon = value ; } public get fallbackIcon ( ) : string { if ( this . fallBackIcon === undefined || this . fallBackIcon === '' ) { return 'fa fa-cube' ; } return this . fallBackIcon ; } onIconPickerSelect ( value ) { this . iconFormGroup . get ( 'icon' ) . setValue ( value ) ; } }