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

159
Visualizações
AngularJS - Tippy not functioning on last item in ng-repeat

I have an angularjs (unfortunately a necessity) component that renders in an ng-repeat.

<parent-li ng-repeat="item in layout">
 <component-with-tippy item="item"></component-with-tippy>
</parent-li>

The component has a tippy which I instantiate through the attribute configuration

<div>
 <button data-tippy-content="This is the button"></button>
</div>

The componentWithTippy.js has this in the controller:

// Tippy
  tippy('[data-tippy-content]',
    {
      trigger: 'mouseenter',
    }
  )

The problem I have is that the tippy works on all but the last item in the layout array. And if I add an item to the layout array the tippy then works on the previous last item but won't work on the new last item.

I've console.logged the items to see if the last one has any difference but it does not.

Is this an angularjs init thing?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

What you want, is to call tippy after the component is ready. In angularjs you can achieve that in two ways:

Solution Ⅰ. Use $timeout without a delay:

$timeout(function () {
 tippy('[data-tippy]', {
  content: "I'm a Tippy tooltip!",
 });
});

Solution ⅠⅠ. Use .ready() which is provided by Angular's jqLite:

$element.ready(function () {
 tippy('[data-tippy]', {
  content: "I'm a Tippy tooltip!",
 });
});
about 4 years ago · Juan Pablo Isaza Relatório
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