import { BoundItemBase } from "./BoundItemBase" ; import { UkuleleUtil } from "../util/UkuleleUtil" ; export class BoundItemAttribute extends BoundItemBase { ukuTag : string ; constructor ( attrName , ukuTag , element , uku ) { super ( attrName , element , uku ) ; this . ukuTag = ukuTag ; } render ( controllers ) { let attr = this . attributeName ; let finalValue = UkuleleUtil . getFinalValue ( controllers , attr ) ; if ( typeof finalValue === 'boolean' ) { if ( finalValue === true ) { this . element . setAttribute ( this . ukuTag , this . ukuTag ) ; } else { this . element . removeAttribute ( this . ukuTag ) ; } } else { this . element . setAttribute ( this . ukuTag , finalValue ) ; } } }