Skip to content

Commit f101ac3

Browse files
committed
refactor(sidebar-nav): IconDirective imports
1 parent a785899 commit f101ac3

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav-group.component.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[cHtmlAttr]="item.attributes"
33
class="nav-link nav-group-toggle"
44
href>
5-
<ng-container *ngTemplateOutlet="iconTemplate ; context: {$implicit: item}"></ng-container>
5+
<ng-container *ngTemplateOutlet="iconTemplate ; context: {$implicit: item}" />
66
<ng-container>{{ item.name }}</ng-container>
77
<span *ngIf="helper.hasBadge(item)" [ngClass]="item | cSidebarNavBadge">{{ item.badge.text }}</span>
88
</a>
@@ -14,8 +14,7 @@
1414
[groupItems]="true"
1515
[navItems]="navItems"
1616
[ngStyle]="display"
17-
>
18-
</c-sidebar-nav>
17+
/>
1918

2019
<ng-template #iconTemplate let-item>
2120
<i *ngIf="item?.icon" [ngClass]="item | cSidebarNavIcon"></i>
@@ -24,7 +23,7 @@
2423
[cIcon]="item.iconComponent?.content"
2524
[customClasses]="item | cSidebarNavIcon"
2625
[name]="item.iconComponent?.name"
27-
></svg>
26+
/>
2827
</ng-template>
2928
<span *ngIf="!item?.icon && !item?.iconComponent" [ngClass]="item | cSidebarNavIcon"></span>
3029
</ng-template>

projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav-link.component.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { INavData } from './sidebar-nav';
1111
import { SidebarNavLinkPipe } from './sidebar-nav-link.pipe';
1212
import { SidebarNavBadgePipe } from './sidebar-nav-badge.pipe';
1313
import { SidebarNavIconPipe } from './sidebar-nav-icon.pipe';
14-
import { IconModule } from '@coreui/icons-angular'
14+
import { IconDirective } from '@coreui/icons-angular';
1515

1616
@Component({
1717
selector: 'c-sidebar-nav-link-content',
@@ -37,7 +37,16 @@ export class SidebarNavLinkContentComponent {
3737
templateUrl: './sidebar-nav-link.component.html',
3838
providers: [SidebarNavHelper],
3939
standalone: true,
40-
imports: [CommonModule, RouterModule, HtmlAttributesDirective, SidebarNavLinkContentComponent, SidebarNavLinkPipe, SidebarNavBadgePipe, SidebarNavIconPipe, IconModule]
40+
imports: [
41+
CommonModule,
42+
RouterModule,
43+
HtmlAttributesDirective,
44+
IconDirective,
45+
SidebarNavLinkContentComponent,
46+
SidebarNavLinkPipe,
47+
SidebarNavBadgePipe,
48+
SidebarNavIconPipe
49+
]
4150
})
4251
export class SidebarNavLinkComponent implements OnInit, OnDestroy {
4352

projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ import { INavData } from './sidebar-nav';
3333
import { SidebarNavHelper } from './sidebar-nav.service';
3434
import { SidebarNavGroupService } from './sidebar-nav-group.service';
3535
import { HtmlAttributesDirective } from '../../shared';
36-
import { IconModule } from '@coreui/icons-angular';
3736
import { SidebarNavIconPipe } from './sidebar-nav-icon.pipe';
3837
import { SidebarNavBadgePipe } from './sidebar-nav-badge.pipe';
3938
import { SidebarNavLinkComponent } from './sidebar-nav-link.component';
4039
import { SidebarNavLabelComponent } from './sidebar-nav-label.component';
4140
import { SidebarNavTitleComponent } from './sidebar-nav-title.component';
4241
import { SidebarNavDividerComponent } from './sidebar-nav-divider.component';
4342
import { SidebarNavItemClassPipe } from './sidebar-nav-item-class.pipe';
43+
import { IconDirective } from '@coreui/icons-angular';
4444

4545
@Component({
4646
selector: 'c-sidebar-nav-group',
@@ -50,10 +50,10 @@ import { SidebarNavItemClassPipe } from './sidebar-nav-item-class.pipe';
5050
standalone: true,
5151
imports: [
5252
HtmlAttributesDirective,
53+
IconDirective,
5354
NgTemplateOutlet,
5455
NgIf,
5556
NgClass,
56-
IconModule,
5757
SidebarNavIconPipe,
5858
SidebarNavBadgePipe,
5959
forwardRef(() => SidebarNavComponent),

0 commit comments

Comments
 (0)