Skip to content

Commit 84e30a1

Browse files
committed
fix(carousel-control): allow custom content (regression)
1 parent 713ecd2 commit 84e30a1

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
@if (hasContent()) {
2-
<div #content>
3-
<ng-content />
4-
</div>
5-
} @else {
6-
<span [class]="carouselControlIconClass()" [attr.aria-label]="direction()" [attr.aria-hidden]="true"></span>
1+
<ng-content>
2+
<span [attr.aria-hidden]="true" [class]="carouselControlIconClass()"></span>
73
<span class="visually-hidden">{{ caption() }}</span>
8-
}
4+
</ng-content>

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

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, computed, ElementRef, inject, input, linkedSignal, viewChild } from '@angular/core';
1+
import { Component, computed, inject, input, linkedSignal } from '@angular/core';
22

33
import { CarouselState } from '../carousel-state';
44

@@ -49,12 +49,6 @@ export class CarouselControlComponent {
4949
return `carousel-control-${this.direction()}-icon`;
5050
});
5151

52-
readonly content = viewChild('content', { read: ElementRef });
53-
54-
readonly hasContent = computed(() => {
55-
return this.content()?.nativeElement.childNodes.length ?? false;
56-
});
57-
5852
onKeyUp($event: KeyboardEvent): void {
5953
if ($event.key === 'Enter') {
6054
this.#play();

0 commit comments

Comments
 (0)