Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

387
Views
Posición: polyfill pegajoso para angular 2

¿Hay algún relleno de polietileno disponible para la posición angular 2: pegajoso? He podido encontrar algunos, pero la mayoría de ellos están basados en jquery, parece que no hay una implementación disponible para angular 2:

https://github.com/wilddeer/stickyfill

Necesito saber el uso de la muestra con angular 2,

para Javascript es el siguiente:

 var stickyElements = document.getElementsByClassName('sticky'); for (var i = stickyElements.length - 1; i >= 0; i--) { Stickyfill.add(stickyElements[i]); }
about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Lo agregué como una directiva en el paquete angular 1.4 y npm "stickyfilljs":"^2.0.3"

 import { Directive, ElementRef } from '@angular/core'; import * as Stickyfill from 'stickyfilljs'; @Directive({ selector: '[StickyPolyfill]' }) export class StickyPolyfillDirective { constructor(private elementRef: ElementRef) { } ngAfterViewInit() { Stickyfill.addOne(this.elementRef.nativeElement); } }

Y en el componente tengo:

 <div class="top-bar-container stickyMenu" StickyPolyfill>

No olvides incluir sticky en CSS:

 .stickyMenu { position: -webkit-sticky; position: -moz-sticky; position: -o-sticky; position: -ms-sticky; position: sticky; top: 0px; }
about 4 years ago · Santiago Trujillo Report

0

No tiene nada que ver con Angular. Lo que está buscando es un Polyfill para manejar algo que no está implementado en un navegador, esto no está directamente vinculado con jQuery o Angular, solo está vinculado a su navegador.

El que vinculó es bueno, solo agréguelo a su proceso de compilación o a su matriz de activos si está usando Angular-CLI.

Puede usarlo simplemente declarando la variable como cualquier elemento, agregue esto al comienzo de uno de sus archivos ts:

 declare var Stickyfill: any;
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!