import { Component , Input } from '@angular/core' ; import { ToastService } from '../../../../layout/toast/toast.service' ; import { RenderResult } from '../../../models/cmdb-render' ; import { CmdbMode } from '../../../modes.enum' ; @ Component ( { selector : 'cmdb-object-summary' , templateUrl : './object-summary.component.html' , styleUrls : [ './object-summary.component.scss' ] } ) export class ObjectSummaryComponent { @ Input ( ) summaries : any = [ ] ; @ Input ( ) renderResult : RenderResult ; public mode : CmdbMode = CmdbMode . Simple ; public constructor ( private toast ) { } public clipBoardSummary ( data ) { const selBox = document . createElement ( 'textarea' ) ; selBox . style . position = 'fixed' ; selBox . style . left = '0' ; selBox . style . top = '0' ; selBox . style . opacity = '0' ; selBox . value = data ; document . body . appendChild ( selBox ) ; selBox . focus ( ) ; selBox . select ( ) ; document . execCommand ( 'copy' ) ; document . body . removeChild ( selBox ) ; this . toast . info ( 'Summary was copied to clipboard' ) ; } }