Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda