File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 1- import { Component , HostBinding , Input } from '@angular/core' ;
1+ import { Component , computed , input , InputSignal } from '@angular/core' ;
22
33import { Positions } from '../coreui.types' ;
44
55@Component ( {
66 selector : 'c-footer, [cFooter]' ,
77 template : '<ng-content />' ,
88 standalone : true ,
9- host : { class : 'footer' }
9+ host : {
10+ class : 'footer' ,
11+ '[class]' : 'hostClasses()' ,
12+ '[attr.role]' : 'role()'
13+ }
1014} )
1115export class FooterComponent {
1216 /**
1317 * Place footer in non-static positions. [docs]
1418 * @type Positions
1519 */
16- @ Input ( ) position ?: Positions ;
20+ readonly position : InputSignal < Positions | undefined > = input ( ) ;
1721
1822 /**
1923 * Default role for footer. [docs]
2024 * @type string
2125 * @default 'contentinfo'
2226 */
23- @HostBinding ( 'attr.role' )
24- @Input ( )
25- role = 'contentinfo' ;
27+ readonly role : InputSignal < string > = input ( 'contentinfo' ) ;
2628
27- @HostBinding ( 'class' )
28- get getClasses ( ) : any {
29+ readonly hostClasses = computed ( ( ) => {
2930 return {
3031 footer : true ,
31- [ `footer-${ this . position } ` ] : ! ! this . position
32- } ;
33- }
32+ [ `footer-${ this . position ( ) } ` ] : ! ! this . position ( )
33+ } as Record < string , boolean > ;
34+ } ) ;
3435}
You can’t perform that action at this time.
0 commit comments