Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
Did not find why angular2 component not able to bind foundation modal on revisiting the tab

I have a parent component which calls another component which renders the modal on the same page. On first load parent component is able to pass the data to child component. but once i go to another page and comes back then data from parent is not getting bound to child components modal.

Steps to follow in plunker:-

  1. Enter any value in 1st input box(abcd)
  2. Enter modal1 in 2nd textbox
  3. click on modal1 button
  4. correct value in modal will apeear
  5. change value in 1st textbox to abcdef
  6. change second text box value to modal2
  7. click on modal2 button
  8. correct value will come
  9. now rechange value in first textbox to abcedfghij
  10. change value to modal1 in 1st textbox
  11. click on modal1
  12. value not getting updated. It should get updated as binding is on the same field and passed to both components.

Plunker:- https://plnkr.co/edit/GNPyL6DzzxCzUD8VZMRF?p=preview

    {
    import {Component,AfterViewInit} from '@angular/core'        
    @Component({
      selector: 'revel2',
      inputs: ['value']
      template: `
      <div id="myModal2" class="small reveal" data-reveal  aria-hidden="true" role="dialog">
    I am Modal2 and I got value from parent component as:-
    {{value}}
    </div>`

    })
    export class ModalComponent2  {
      value:string;
      ngAfterViewInit(): void {
        $('#myModal2').foundation();
        $(window).trigger('open.fndtn.reveal');
      }

    }
    }
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda