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 11import { Component , HostBinding , Input } from '@angular/core' ;
22import { Colors , TextColors } from '../coreui.types' ;
3+ import { TextColorDirective } from '../utilities' ;
34
45@Component ( {
56 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+ } ]
812} )
913export class CardComponent {
1014
@@ -13,8 +17,10 @@ export class CardComponent {
1317 * @type Colors
1418 */
1519 @Input ( ) color ?: Colors ;
20+
1621 /**
1722 * Sets the text color context of the component to one of CoreUI’s themed colors.
23+ * via TextColorDirective
1824 * @type TextColors
1925 */
2026 @Input ( ) textColor ?: TextColors ;
@@ -23,11 +29,7 @@ export class CardComponent {
2329 get hostClasses ( ) : any {
2430 return {
2531 card : true ,
26- [ `bg-${ this . color } ` ] : ! ! this . color ,
27- [ `text-${ this . textColor } ` ] : ! ! this . textColor ,
32+ [ `bg-${ this . color } ` ] : ! ! this . color
2833 } ;
2934 }
30-
31- constructor ( ) { }
32-
3335}
You can’t perform that action at this time.
0 commit comments