Skip to content

Commit dac4f4b

Browse files
committed
refactor: minor syntax cleanups
1 parent 371cec8 commit dac4f4b

File tree

55 files changed

+70
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+70
-94
lines changed

projects/coreui-angular/src/lib/accordion/accordion-item/accordion-item.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<ng-container>
22
<div class="accordion-header">
3-
<ng-container *ngTemplateOutlet="templates['accordionHeaderTemplate'] || defaultAccordionHeaderTemplate; context: itemContext"></ng-container>
3+
<ng-container *ngTemplateOutlet="templates['accordionHeaderTemplate'] || defaultAccordionHeaderTemplate; context: itemContext" />
44
</div>
55
<div class="accordion-collapse" cCollapse [visible]="visible" [attr.aria-expanded]="visible" [id]="contentId">
6-
<ng-container *ngTemplateOutlet="templates['accordionBodyTemplate'] || defaultAccordionBodyTemplate; context: itemContext"></ng-container>
6+
<ng-container *ngTemplateOutlet="templates['accordionBodyTemplate'] || defaultAccordionBodyTemplate; context: itemContext" />
77
</div>
88
</ng-container>
99

@@ -16,7 +16,7 @@
1616
</ng-template>
1717

1818
<ng-template #defaultAccordionHeaderContentTemplate>
19-
<ng-content></ng-content>
19+
<ng-content />
2020
</ng-template>
2121

2222
<ng-template #defaultAccordionBodyTemplate>
@@ -28,5 +28,5 @@
2828
</ng-template>
2929

3030
<ng-template #defaultAccordionBodyContentTemplate>
31-
<ng-content></ng-content>
31+
<ng-content />
3232
</ng-template>

projects/coreui-angular/src/lib/alert/alert.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@if (dismissible) {
33
<ng-container *ngTemplateOutlet="templates?.alertButtonCloseTemplate || defaultAlertButtonCloseTemplate" />
44
}
5-
<ng-content></ng-content>
5+
<ng-content />
66
}
77
<ng-template #defaultAlertButtonCloseTemplate>
88
<button (click)="visible=false" aria-label="Close" cButtonClose></button>
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ng-container>
2-
<ng-container *ngTemplateOutlet="defaultImageTemplate"></ng-container>
2+
<ng-container *ngTemplateOutlet="defaultImageTemplate" />
33
@if (!!status) {
44
<span [ngClass]="statusClass"></span>
55
}
@@ -9,9 +9,6 @@
99
@if (!!src) {
1010
<img [src]="src" class="avatar-img" />
1111
} @else {
12-
<ng-content></ng-content>
12+
<ng-content />
1313
}
14-
<ng-template #imageContent>
15-
<ng-content></ng-content>
16-
</ng-template>
1714
</ng-template>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<c-breadcrumb class="m-0">
22
@for (breadcrumb of breadcrumbs | async; track breadcrumb; let last = $last) {
3-
@if(breadcrumb?.label && (breadcrumb?.url?.slice(-1) === '/' || last)) {
3+
@if (breadcrumb?.label && (breadcrumb?.url?.slice(-1) === '/' || last)) {
44
<c-breadcrumb-item
55
[active]="last"
66
[url]="breadcrumb?.url"

projects/coreui-angular/src/lib/breadcrumb/breadcrumb-router/breadcrumb-router.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import { IBreadcrumbItem } from '../breadcrumb-item/breadcrumb-item';
1111
export class BreadcrumbRouterService {
1212
public outlet = 'primary';
1313

14-
readonly #breadcrumbsBehaviorSubject = new BehaviorSubject<IBreadcrumbItem[]>(new Array<IBreadcrumbItem>());
15-
breadcrumbs$ = this.#breadcrumbsBehaviorSubject.asObservable();
14+
readonly #breadcrumbsBehaviorSubject: BehaviorSubject<IBreadcrumbItem[]> = new BehaviorSubject<IBreadcrumbItem[]>(new Array<IBreadcrumbItem>());
15+
readonly breadcrumbs$: Observable<IBreadcrumbItem[]> = this.#breadcrumbsBehaviorSubject.asObservable();
1616

1717
constructor(private router: Router, private route: ActivatedRoute) {
1818

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, HostBinding, Input } from '@angular/core';
22

33
@Component({
44
selector: 'c-breadcrumb',
5-
template: '<ng-content></ng-content>',
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class BreadcrumbComponent {
@@ -26,9 +26,6 @@ export class BreadcrumbComponent {
2626
get hostClasses() {
2727
return {
2828
breadcrumb: true
29-
}
29+
};
3030
}
31-
32-
constructor() { }
33-
3431
}

projects/coreui-angular/src/lib/button-group/button-group/button-group.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, HostBinding, Input } from '@angular/core';
22

33
@Component({
44
selector: 'c-button-group',
5-
template: `<ng-content></ng-content>`,
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class ButtonGroupComponent {
@@ -30,11 +30,8 @@ export class ButtonGroupComponent {
3030
return {
3131
'btn-group': !this.vertical,
3232
'btn-group-vertical': this.vertical,
33-
[`btn-group-${this.size}`]: !!this.size,
33+
[`btn-group-${this.size}`]: !!this.size
3434
};
3535
}
3636

37-
38-
constructor() { }
39-
4037
}

projects/coreui-angular/src/lib/button-group/button-toolbar/button-toolbar.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, HostBinding, Input } from '@angular/core';
22

33
@Component({
44
selector: 'c-button-toolbar',
5-
template: `<ng-content></ng-content>`,
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class ButtonToolbarComponent {
@@ -17,10 +17,7 @@ export class ButtonToolbarComponent {
1717
@HostBinding('class')
1818
get hostClasses(): any {
1919
return {
20-
'btn-toolbar': true,
20+
'btn-toolbar': true
2121
};
2222
}
23-
24-
constructor() { }
25-
2623
}

projects/coreui-angular/src/lib/callout/callout.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Colors } from '../coreui.types';
33

44
@Component({
55
selector: 'c-callout, [cCallout]',
6-
template: `<ng-content></ng-content>`,
6+
template: '<ng-content />',
77
styleUrls: ['./callout.component.scss'],
88
standalone: true
99
})
@@ -17,13 +17,10 @@ export class CalloutComponent {
1717

1818
@HostBinding('class')
1919
get hostClasses(): any {
20-
2120
return {
2221
callout: true,
2322
[`callout-${this.color}`]: !!this.color
2423
};
2524
}
2625

27-
constructor() { }
28-
2926
}

projects/coreui-angular/src/lib/card/card-body.component.ts

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

33
@Component({
44
selector: 'c-card-body, [c-card-body]',
5-
template: '<ng-content></ng-content>',
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class CardBodyComponent {

0 commit comments

Comments
 (0)