1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Setting signal input on a component in ng boostrap modal

Discussão em 'Angular' iniciado por Guillaume, Outubro 16, 2024.

  1. Guillaume

    Guillaume Guest

    In Angular 17.3, I have a component that is using some signal inputs, like

    myInput = input(false);


    I want to show this component in a modal, using ng-bootstrap. Is it possible to do this, and set the value of myInput? I have tried

    private modalService = inject(NgbModal);

    const modalRef = this.modalService.open(MyComponent);
    modalRef.componentInstance.myInput = true;


    as shown in the bootstrap documentation, but this seems to override the field myInput to turn it into a boolean instead of a signal. I tried

    modalRef.componentInstance.myInput.set(true);


    but it says "modalRef.componentInstance.myInput.set is not a function".

    Is this at all possible? or it's just not compatible with signals?

    Continue reading...

Compartilhe esta Página