Skip to content

Commit 0787927

Browse files
committed
fix(toast): use placement getter for backward compatibility
1 parent 6f2f307 commit 0787927

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ export class ToastComponent implements OnInit, OnDestroy {
6262
readonly toasterService = inject(ToasterService);
6363

6464
readonly dynamic = input<boolean>();
65-
readonly placement = input<TToasterPlacement>();
65+
readonly placementInput = input<TToasterPlacement>(undefined, { alias: 'placement' });
66+
67+
get placement() {
68+
return this.placementInput();
69+
}
6670

6771
/**
6872
* Auto hide the toast.
@@ -170,7 +174,7 @@ export class ToastComponent implements OnInit, OnDestroy {
170174
this.toasterService.setState({
171175
toast: this,
172176
show: this.visible,
173-
placement: this.placement()
177+
placement: this.placement
174178
});
175179
this.clearTimer();
176180
this.setTimer();
@@ -200,7 +204,7 @@ export class ToastComponent implements OnInit, OnDestroy {
200204
this.toasterService.setState({
201205
toast: this,
202206
show: false,
203-
placement: this.placement()
207+
placement: this.placement
204208
});
205209
}
206210

0 commit comments

Comments
 (0)