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

+4-4
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

+1-1
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>
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

+1-1
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

+2-2
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

+2-5
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

+2-5
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

+2-5
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

+1-4
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

+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: 'c-card-body, [c-card-body]',
5-
template: '<ng-content></ng-content>',
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class CardBodyComponent {

projects/coreui-angular/src/lib/card/card-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: 'c-card-footer, [c-card-footer]',
5-
template: '<ng-content></ng-content>',
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class CardFooterComponent {

projects/coreui-angular/src/lib/card/card-group.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: 'c-card-group, [c-card-group]',
5-
template: '<ng-content></ng-content>',
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class CardGroupComponent {

projects/coreui-angular/src/lib/card/card-header-actions.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: 'c-card-header-actions, [c-card-header-actions]',
5-
template: '<ng-content></ng-content>',
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class CardHeaderActionsComponent {

projects/coreui-angular/src/lib/card/card-header.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: 'c-card-header, [c-card-header]',
5-
template: '<ng-content></ng-content>',
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class CardHeaderComponent {

projects/coreui-angular/src/lib/card/card-img-overlay/card-img-overlay.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: 'c-card-img-overlay',
5-
template: `<ng-content></ng-content>`,
5+
template: '<ng-content />',
66
styleUrls: ['./card-img-overlay.component.scss'],
77
standalone: true
88
})

projects/coreui-angular/src/lib/carousel/carousel-caption/carousel-caption.component.ts

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

33
@Component({
44
selector: 'c-carousel-caption',
5-
template: `<ng-content></ng-content>`,
5+
template: '<ng-content />',
66
styleUrls: ['./carousel-caption.component.scss'],
77
standalone: true
88
})
99
export class CarouselCaptionComponent {
1010

1111
@HostBinding('class.carousel-caption') carouselCaptionClass = true;
1212

13-
constructor() { }
14-
1513
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div [@slideAnimation]="slide" [@.disabled]="!animate">
2-
<ng-content></ng-content>
2+
<ng-content />
33
</div>
44
<!--todo-->
55
<!--<div [@fadeAnimation]="slide" [@.disabled]="!animate" >-->
6-
<!-- <ng-content></ng-content>-->
6+
<!-- <ng-content />-->
77
<!--</div>-->
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<!--todo ngIf-->
21
@if (active) {
32
<ng-content />
43
}

projects/coreui-angular/src/lib/collapse/collapse.directive.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
88
class MockElementRef extends ElementRef {}
99

1010
@Component({
11-
template: `<div cCollapse></div>`
11+
template: '<div cCollapse></div>'
1212
})
1313
class TestComponent {}
1414

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Positions } from '../coreui.types';
44

55
@Component({
66
selector: 'c-footer, [cFooter]',
7-
template: `<ng-content></ng-content>`,
7+
template: '<ng-content />',
88
standalone: true
99
})
1010
export class FooterComponent {
@@ -25,7 +25,7 @@ export class FooterComponent {
2525
get getClasses(): any {
2626
return {
2727
footer: true,
28-
[`footer-${this.position}`]: !!this.position,
28+
[`footer-${this.position}`]: !!this.position
2929
};
3030
}
3131
}

projects/coreui-angular/src/lib/form/form-check/form-check-input.directive.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { By } from '@angular/platform-browser';
44
import { FormCheckInputDirective } from './form-check-input.directive';
55

66
@Component({
7-
template: `<input cFormCheckInput>`
7+
template: '<input cFormCheckInput>'
88
})
99
class TestComponent {}
1010

projects/coreui-angular/src/lib/form/form-check/form-check.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FormCheckLabelDirective } from './form-check-label.directive';
44

55
@Component({
66
selector: 'c-form-check',
7-
template: '<ng-content></ng-content>',
7+
template: '<ng-content />',
88
exportAs: 'cFormCheck',
99
standalone: true
1010
})

projects/coreui-angular/src/lib/form/form-feedback/form-feedback.component.ts

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

33
@Component({
44
selector: 'c-form-feedback',
5-
template: '<ng-content></ng-content>',
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class FormFeedbackComponent {
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import {
2-
Component,
3-
HostBinding,
4-
Input,
5-
} from '@angular/core';
1+
import { Component, HostBinding, Input } from '@angular/core';
62

73
@Component({
84
selector: 'c-input-group',
9-
template: `<ng-content></ng-content>`,
5+
template: '<ng-content />',
106
standalone: true
117
})
128
export class InputGroupComponent {
@@ -19,10 +15,8 @@ export class InputGroupComponent {
1915
get hostClasses(): any {
2016
return {
2117
'input-group': true,
22-
[`input-group-${this.sizing}`]: !!this.sizing,
18+
[`input-group-${this.sizing}`]: !!this.sizing
2319
};
2420
}
2521

26-
constructor() {}
27-
2822
}

projects/coreui-angular/src/lib/grid/col.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ColDirective } from './col.directive';
44

55
@Component({
66
selector: 'c-col',
7-
template: '<ng-content></ng-content>',
7+
template: '<ng-content />',
88
styleUrls: ['./col.component.scss'],
99
standalone: true
1010
})

projects/coreui-angular/src/lib/grid/container.component.ts

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

66
@Component({
77
selector: 'c-container, [cContainer]',
8-
template: '<ng-content></ng-content>',
8+
template: '<ng-content />',
99
styleUrls: ['./container.component.scss'],
1010
standalone: true
1111
})

projects/coreui-angular/src/lib/grid/row.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RowDirective } from './row.directive';
44

55
@Component({
66
selector: 'c-row',
7-
template: '<ng-content></ng-content>',
7+
template: '<ng-content />',
88
standalone: true
99
})
1010
export class RowComponent extends RowDirective {}

projects/coreui-angular/src/lib/header/header-brand/header-brand.component.ts

+1-1
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-header-brand',
5-
template: `<ng-content></ng-content>`,
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class HeaderBrandComponent {

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

+1-1
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-header-nav',
5-
template: `<ng-content></ng-content>`,
5+
template: '<ng-content />',
66
styleUrls: ['./header-nav.component.scss'],
77
standalone: true
88
})

projects/coreui-angular/src/lib/header/header-text/header-text.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: 'c-header-text, [cHeaderText]',
5-
template: `<ng-content></ng-content>`,
5+
template: '<ng-content />',
66
standalone: true
77
})
88
export class HeaderTextComponent {

projects/coreui-angular/src/lib/list-group/list-group-item.directive.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { By } from '@angular/platform-browser';
66
class MockElementRef extends ElementRef {}
77

88
@Component({
9-
template: `<li cListGroupItem></li>`
9+
template: '<li cListGroupItem></li>'
1010
})
1111
class TestComponent {}
1212

projects/coreui-angular/src/lib/modal/modal-body/modal-body.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: 'c-modal-body',
5-
template: '<ng-content></ng-content>',
5+
template: '<ng-content />',
66
styleUrls: ['./modal-body.component.scss'],
77
standalone: true
88
})

0 commit comments

Comments
 (0)