NgbOffcanvasRef and NgbModalRef should expose a ComponentRef
Author: pkfmsCreated Mar 28, 2024Updated Jul 26, 2026
Bug description:
NgbOffcanvasRef and NgbModalRef should expose a ComponentRef when using a component type as content. Currently the NgbOffcanvasRef exposes a componentInstance. This makes it hard to use components with Signal inputs, as you cannot do myComponentInstance.myProp = value. Instead, the proper way is to use the function setInput on a componentRef. setInput also triggers change detection and ngOnChanges correctly.
Link to minimally-working StackBlitz that reproduces the issue:
https://stackblitz.com/edit/angular-5zsark-l3yj9i
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 17.3.1
ng-bootstrap: 16.0.0
Bootstrap: 5.3.3
Source: ng-bootstrap/ng-bootstrap