import { Component , Input } from '@angular/core' ; @ Component ( { selector : 'setting-drawer-item' , templateUrl : './setting-drawer-item.component.html' , host : { '[class.setting-drawer__body-item]' : 'true' , } , } ) export class SettingDrawerItemComponent { i : any = { } ; @ Input ( ) set data ( val ) { this . i = val ; if ( val . type === 'px' ) { this . pxVal = + val . value . replace ( 'px' , '' ) ; } } pxVal : number ; pxChange ( val ) { this . i . value = `${ val }px` ; } format = value => `${ value } px` ; }