Skip to content

Commit 568d77c

Browse files
committed
chore: minor cleanups
1 parent 2433ea3 commit 568d77c

20 files changed

+40
-46
lines changed

projects/coreui-angular/src/lib/aside/app-aside.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { asideMenuCssClasses } from '../shared';
55

66
@Component({
77
selector: 'app-aside, cui-aside',
8-
template: `<ng-content></ng-content>`,
8+
template: `<ng-content />`,
99
standalone: true
1010
})
1111
export class AppAsideComponent implements OnInit, OnDestroy {

projects/coreui-angular/src/lib/breadcrumb/app-breadcrumb.component.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { Component, ElementRef, Inject, Input, OnDestroy, OnInit, Renderer2 } from '@angular/core';
2-
import { DOCUMENT, NgClass, NgIf } from '@angular/common';
2+
import {AsyncPipe, DOCUMENT, NgClass, NgForOf, NgIf} from '@angular/common';
33

44
import { AppBreadcrumbService } from './app-breadcrumb.service';
55
import { Replace } from '../shared';
66
import { Observable } from 'rxjs';
77
import { RouterLink } from '@angular/router';
88

99
@Component({
10-
selector: 'app-breadcrumb',
11-
template: `
10+
selector: 'app-breadcrumb',
11+
template: `
1212
<ng-template ngFor let-breadcrumb [ngForOf]="breadcrumbs | async" let-last = last>
1313
<li class="breadcrumb-item"
1414
*ngIf="breadcrumb.label.title && (breadcrumb.url.slice(-1) == '/' || last)"
@@ -18,8 +18,7 @@ import { RouterLink } from '@angular/router';
1818
</li>
1919
</ng-template>
2020
`,
21-
standalone: true,
22-
imports: [NgIf, NgClass, RouterLink]
21+
imports: [NgIf, NgClass, RouterLink, NgForOf, AsyncPipe]
2322
})
2423
export class AppBreadcrumbComponent implements OnInit, OnDestroy {
2524
@Input() fixed?: boolean;

projects/coreui-angular/src/lib/breadcrumb/cui-breadcrumb.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<span *ngIf="last" [routerLink]="breadcrumb.url">{{breadcrumb.label.title}}</span>
88
</li>
99
</ng-template>
10-
<ng-content></ng-content>
10+
<ng-content />
1111
</ol>

projects/coreui-angular/src/lib/breadcrumb/cui-breadcrumb.component.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ import { Observable } from 'rxjs';
66
import { AppBreadcrumbService } from './app-breadcrumb.service';
77

88
@Component({
9-
// tslint:disable-next-line:component-selector
10-
selector: 'cui-breadcrumb',
11-
templateUrl: './cui-breadcrumb.component.html',
12-
standalone: true,
13-
imports: [NgIf, NgClass, RouterLink, AsyncPipe, NgForOf]
9+
// tslint:disable-next-line:component-selector
10+
selector: 'cui-breadcrumb',
11+
templateUrl: './cui-breadcrumb.component.html',
12+
imports: [NgIf, NgClass, RouterLink, AsyncPipe, NgForOf]
1413
})
1514
export class CuiBreadcrumbComponent implements OnInit, OnDestroy {
1615
@Input() fixed?: boolean;

projects/coreui-angular/src/lib/footer/app-footer.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DOCUMENT } from '@angular/common';
33

44
@Component({
55
selector: 'app-footer, cui-footer',
6-
template: `<ng-content></ng-content>`,
6+
template: `<ng-content />`,
77
standalone: true
88
})
99
export class AppFooterComponent implements OnInit, OnDestroy {

projects/coreui-angular/src/lib/header/app-header.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<span class="navbar-toggler-icon"></span>
2626
</button>
2727
</ng-template>
28-
<ng-content></ng-content>
28+
<ng-content />
2929
<ng-template [ngIf]="asideMenuToggler != false">
3030
<button class="navbar-toggler {{asideTogglerClass}}" type="button" [appAsideMenuToggler]="asideMenuToggler">
3131
<span class="navbar-toggler-icon"></span>

projects/coreui-angular/src/lib/sidebar/app-sidebar-footer.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, HostBinding } from '@angular/core';
22

33
@Component({
44
selector: 'app-sidebar-footer, cui-sidebar-footer',
5-
template: `<ng-content></ng-content>`,
5+
template: `<ng-content />`,
66
standalone: true
77
})
88
export class AppSidebarFooterComponent {

projects/coreui-angular/src/lib/sidebar/app-sidebar-form.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import { Component, HostBinding } from '@angular/core';
22

33
@Component({
44
selector: 'app-sidebar-form, cui-sidebar-form',
5-
template: `<ng-content></ng-content>`,
5+
template: `<ng-content />`,
66
standalone: true
77
})
88
export class AppSidebarFormComponent {
99

1010
@HostBinding('class.sidebar-form') sidebarFormClass = true;
1111

12-
constructor() { }
1312
}

projects/coreui-angular/src/lib/sidebar/app-sidebar-header.component.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ import { Component, HostBinding } from '@angular/core';
22

33
@Component({
44
selector: 'app-sidebar-header, cui-sidebar-header',
5-
template: `<ng-content></ng-content>`,
5+
template: `<ng-content />`,
66
standalone: true
77
})
88
export class AppSidebarHeaderComponent {
99

1010
@HostBinding('class.sidebar-header') sidebarHeaderClass = true;
11-
12-
constructor() { }
1311
}

projects/coreui-angular/src/lib/sidebar/app-sidebar-nav.service.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { Injectable } from '@angular/core';
2-
import { RouterTestingModule } from '@angular/router/testing';
32

43
import { INavData } from './app-sidebar-nav';
5-
import { Router } from '@angular/router';
64

75
@Injectable()
86
export abstract class SidebarNavService {

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

-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,4 @@ import { INavData } from '../app-sidebar-nav';
88
})
99
export class AppSidebarNavDividerComponent {
1010
@Input() item?: INavData;
11-
12-
constructor() { }
1311
}

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, Inject, Input, Renderer2, forwardRef } from '@angular/core';
2-
import { Router } from '@angular/router';
2+
import {Router, RouterLinkActive} from '@angular/router';
33
import { DOCUMENT, NgClass, NgFor, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';
44

55
import { SidebarNavHelper } from '../app-sidebar-nav.service';
@@ -19,8 +19,8 @@ import { NavDropdownToggleDirective, NavDropdownDirective } from '../app-sidebar
1919
export abstract class DropdownToken { }
2020

2121
@Component({
22-
selector: 'app-sidebar-nav-items, cui-sidebar-nav-items',
23-
template: `
22+
selector: 'app-sidebar-nav-items, cui-sidebar-nav-items',
23+
template: `
2424
<ng-container *ngFor="let item of items">
2525
<ng-container [ngSwitch]="helper.itemType(item)">
2626
<app-sidebar-nav-dropdown
@@ -78,9 +78,9 @@ export abstract class DropdownToken { }
7878
AppSidebarNavLabelComponent,
7979
AppSidebarNavTitleComponent,
8080
AppSidebarNavDividerComponent,
81-
NavDropdownToggleDirective,
82-
NavDropdownDirective
83-
],
81+
NavDropdownDirective,
82+
RouterLinkActive
83+
]
8484
})
8585
export class AppSidebarNavItemsComponent {
8686

@@ -98,7 +98,7 @@ export class AppSidebarNavItemsComponent {
9898
@Inject(DOCUMENT) private document: Document,
9999
private renderer: Renderer2,
100100
public router: Router,
101-
public helper: SidebarNavHelper,
101+
public helper: SidebarNavHelper,
102102

103103
) { }
104104

@@ -110,8 +110,8 @@ export class AppSidebarNavItemsComponent {
110110
}
111111

112112
@Component({
113-
selector: 'app-sidebar-nav-dropdown, cui-sidebar-nav-dropdown',
114-
template: `
113+
selector: 'app-sidebar-nav-dropdown, cui-sidebar-nav-dropdown',
114+
template: `
115115
<a class="nav-link nav-dropdown-toggle"
116116
appNavDropdownToggle
117117
[appHtmlAttr]="item.attributes">

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
[ngClass]="item | appSidebarNavLink"
44
[appHtmlAttr]="item.attributes"
55
>
6-
<app-sidebar-nav-link-content [item]="item"></app-sidebar-nav-link-content>
6+
<app-sidebar-nav-link-content [item]="item" />
77
</a>
88
<a *ngSwitchCase="'external'"
99
[ngClass]="item | appSidebarNavLink"
1010
[href]="href"
1111
[appHtmlAttr]="item.attributes"
1212
(click)="linkClicked()"
1313
>
14-
<app-sidebar-nav-link-content [item]="item"></app-sidebar-nav-link-content>
14+
<app-sidebar-nav-link-content [item]="item" />
1515
</a>
1616
<a *ngSwitchDefault
1717
[ngClass]="item | appSidebarNavLink"
@@ -30,6 +30,6 @@
3030
[class.active]="linkActive && !item.linkProps?.routerLinkActiveOptions"
3131
(click)="linkClicked()"
3232
>
33-
<app-sidebar-nav-link-content [item]="item"></app-sidebar-nav-link-content>
33+
<app-sidebar-nav-link-content [item]="item" />
3434
</a>
3535
</ng-container>

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ export class AppSidebarNavTitleComponent implements OnInit {
1212
constructor(
1313
private el: ElementRef,
1414
private renderer: Renderer2,
15-
) {
16-
}
15+
) {}
1716

1817
ngOnInit() {
1918
const nativeElement: HTMLElement = this.el.nativeElement;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AppSidebarService } from './app-sidebar.service';
77

88
@Component({
99
selector: 'app-sidebar, cui-sidebar',
10-
template: `<ng-content></ng-content>`,
10+
template: `<ng-content />`,
1111
standalone: true
1212
})
1313
export class AppSidebarComponent implements OnInit, OnDestroy {

src/app/containers/default-layout/default-layout.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import {Component} from '@angular/core';
33
import { navItems } from '../../_nav';
44

55
@Component({
6-
selector: 'app-dashboard',
7-
templateUrl: './default-layout.component.html'
6+
selector: 'app-dashboard',
7+
templateUrl: './default-layout.component.html',
8+
standalone: false
89
})
910
export class DefaultLayoutComponent {
1011
minimized = false;

src/app/views/buttons/brand-buttons.component.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Component } from '@angular/core';
22

33
@Component({
4-
templateUrl: 'brand-buttons.component.html'
4+
templateUrl: 'brand-buttons.component.html',
5+
standalone: false
56
})
67
export class BrandButtonsComponent {
78

src/app/views/buttons/buttons.component.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Component } from '@angular/core';
22

33
@Component({
4-
templateUrl: 'buttons.component.html'
4+
templateUrl: 'buttons.component.html',
5+
standalone: false
56
})
67
export class ButtonsComponent {
78

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Component } from '@angular/core';
22

33
@Component({
4-
templateUrl: 'dashboard.component.html'
4+
templateUrl: 'dashboard.component.html',
5+
standalone: false
56
})
67
export class DashboardComponent {}

src/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<!--
3-
* CoreUI 2 for Angular 18 - test bed
4-
* @version v2.18.0
3+
* CoreUI 2 for Angular 19 - test bed
4+
* @version v2.19.0
55
* @link https://coreui.io/angular/
66
* Copyright (c) 2025 creativeLabs Łukasz Holeczek
77
-->

0 commit comments

Comments
 (0)