@@ -2,6 +2,7 @@ import { Component, HostBinding, Input } from '@angular/core';
22import { NgClass , NgTemplateOutlet } from '@angular/common' ;
33
44import { Colors , Shapes , Sizes , TextColors } from '../coreui.types' ;
5+ import { TextColorDirective } from '../utilities' ;
56
67@Component ( {
78 selector : 'c-avatar' ,
@@ -10,7 +11,10 @@ import { Colors, Shapes, Sizes, TextColors } from '../coreui.types';
1011 imports : [
1112 NgTemplateOutlet ,
1213 NgClass
13- ]
14+ ] ,
15+ hostDirectives : [ {
16+ directive : TextColorDirective , inputs : [ 'cTextColor: textColor' ]
17+ } ]
1418} )
1519export class AvatarComponent {
1620 /**
@@ -38,10 +42,11 @@ export class AvatarComponent {
3842 * @type Colors
3943 */
4044 @Input ( ) status ?: Colors ;
45+
4146 /**
4247 * Sets the text color of the component to one of CoreUI’s themed colors.
43- *
44- * @values 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted' | string
48+ * via TextColorDirective
49+ * @type TextColors
4550 */
4651 @Input ( ) textColor ?: TextColors ;
4752
@@ -60,8 +65,7 @@ export class AvatarComponent {
6065 avatar : true ,
6166 [ `avatar-${ this . size } ` ] : ! ! this . size ,
6267 [ `bg-${ this . color } ` ] : ! ! this . color ,
63- [ `${ this . shape } ` ] : ! ! this . shape ,
64- [ `text-${ this . textColor } ` ] : ! ! this . textColor
68+ [ `${ this . shape } ` ] : ! ! this . shape
6569 } ;
6670 }
6771}
0 commit comments