File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
projects/coreui-angular/src/lib/card Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { Component , HostBinding , Input } from '@angular/core' ;
2
2
import { Colors , TextColors } from '../coreui.types' ;
3
+ import { TextColorDirective } from '../utilities' ;
3
4
4
5
@Component ( {
5
6
selector : 'c-card, [c-card]' ,
6
- template : `<ng-content></ng-content>` ,
7
- standalone : true
7
+ template : '<ng-content />' ,
8
+ standalone : true ,
9
+ hostDirectives : [ {
10
+ directive : TextColorDirective , inputs : [ 'cTextColor: textColor' ]
11
+ } ]
8
12
} )
9
13
export class CardComponent {
10
14
@@ -13,8 +17,10 @@ export class CardComponent {
13
17
* @type Colors
14
18
*/
15
19
@Input ( ) color ?: Colors ;
20
+
16
21
/**
17
22
* Sets the text color context of the component to one of CoreUI’s themed colors.
23
+ * via TextColorDirective
18
24
* @type TextColors
19
25
*/
20
26
@Input ( ) textColor ?: TextColors ;
@@ -23,11 +29,7 @@ export class CardComponent {
23
29
get hostClasses ( ) : any {
24
30
return {
25
31
card : true ,
26
- [ `bg-${ this . color } ` ] : ! ! this . color ,
27
- [ `text-${ this . textColor } ` ] : ! ! this . textColor ,
32
+ [ `bg-${ this . color } ` ] : ! ! this . color
28
33
} ;
29
34
}
30
-
31
- constructor ( ) { }
32
-
33
35
}
You can’t perform that action at this time.
0 commit comments