You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem with this example is that when we set the name input on the component instance, it does not trigger any change detection.
It's not a big issue with this trivial example, as the change detection will be triggered anyway, but it also means setting the name input like this cannot use the @Input transform function and it would had to be done manually.
What I'm suggesting is using the setInput method by exposing the componentRef.
I came here, because of using signal inputs. At least in their current form those inputs are simply not updateable via the normal component class instance. They are not pure signals, so set is not available.
setInput is the only way to update a signal input and without the availability of componentRef, setInput cannot be used.
So for anyone starting to use signal inputs or in the future maybe starting projects only with signal inputs, the modals would not allow input updates.
Hoping this feature makes it through, maybe even without breaking changes 🙏
Bug description:
When using
NgbModal
, we can access thecomponentInstance
from theNgbModalRef
instance.Since the introduction of the new
setInput
method in Angular, I think it could be interesting to expose thecomponentRef
as well.For example, in the
NgbModal
documentation, we can see this example:The problem with this example is that when we set the
name
input on the component instance, it does not trigger any change detection.It's not a big issue with this trivial example, as the change detection will be triggered anyway, but it also means setting the
name
input like this cannot use the@Input
transform function and it would had to be done manually.What I'm suggesting is using the
setInput
method by exposing thecomponentRef
.Here is what it could look like:
Let me know what you think: the change seems small, I can work on a PR if it has some interests.
Link to minimally-working StackBlitz that reproduces the issue:
Not an issue per se, more a feature request :)
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: N/A
ng-bootstrap: ^16.0.0
Bootstrap: N/A
The text was updated successfully, but these errors were encountered: