11import { NgClass , NgOptimizedImage } from '@angular/common' ;
2- import { Component , computed , HostBinding , input , InputSignal } from '@angular/core' ;
2+ import { Component , computed , input , InputSignal } from '@angular/core' ;
33
44import { Colors , Shapes , Sizes , TextColors } from '../coreui.types' ;
55import { TextColorDirective } from '../utilities' ;
@@ -15,7 +15,7 @@ import { TextColorDirective } from '../utilities';
1515 inputs : [ 'cTextColor: textColor' ]
1616 }
1717 ] ,
18- host : { class : 'avatar' }
18+ host : { class : 'avatar' , '[class]' : 'hostClasses()' }
1919} )
2020export class AvatarComponent {
2121 /**
@@ -65,16 +65,15 @@ export class AvatarComponent {
6565 return {
6666 'avatar-status' : true ,
6767 [ `bg-${ this . status ( ) } ` ] : ! ! this . status ( )
68- } ;
68+ } as Record < string , boolean > ;
6969 } ) ;
7070
71- @HostBinding ( 'class' )
72- get hostClasses ( ) : any {
71+ readonly hostClasses = computed ( ( ) => {
7372 return {
7473 avatar : true ,
7574 [ `avatar-${ this . size ( ) } ` ] : ! ! this . size ( ) ,
7675 [ `bg-${ this . color ( ) } ` ] : ! ! this . color ( ) ,
7776 [ `${ this . shape ( ) } ` ] : ! ! this . shape ( )
78- } ;
79- }
77+ } as Record < string , boolean > ;
78+ } ) ;
8079}
0 commit comments