Skip to content

Commit 05740d3

Browse files
committed
refactor(sidebar-toggler): signal inputs, host bindings, cleanup
1 parent 32aa713 commit 05740d3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

projects/coreui-angular/src/lib/sidebar/sidebar-toggler/sidebar-toggler.directive.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { Directive, HostBinding, Input } from '@angular/core';
1+
import { Directive, input } from '@angular/core';
22
import { SidebarToggleDirective } from '../sidebar-toggle/sidebar-toggle.directive';
33

44
@Directive({
55
selector: '[cSidebarToggler]',
6-
hostDirectives: [{ directive: SidebarToggleDirective, inputs: ['cSidebarToggle: cSidebarToggler', 'toggle'] }]
6+
hostDirectives: [{ directive: SidebarToggleDirective, inputs: ['cSidebarToggle: cSidebarToggler', 'toggle'] }],
7+
host: {
8+
'[attr.role]': 'role()',
9+
class: 'sidebar-toggler',
10+
'[style]': 'getStyles'
11+
}
712
})
813
export class SidebarTogglerDirective {
9-
@HostBinding('attr.role')
10-
@Input()
11-
role = 'button';
12-
13-
@HostBinding('class.sidebar-toggler') sidebarTogglerClass = true;
14+
readonly role = input('button');
1415

15-
@HostBinding('style')
1616
get getStyles(): any {
1717
return {
1818
appearance: 'button',

0 commit comments

Comments
 (0)