leafo / sticky-kit

A jQuery plugin for creating smart sticky elements
http://leafo.net/sticky-kit
2.9k stars 517 forks source link

Sticky-kit doesn't work with Angular #275

Closed N-Nagorny closed 3 years ago

N-Nagorny commented 4 years ago

Hi, all.

This jQuery plugin is really great but for some reason I can't use it in an existing Angular project. I installed it with npm, added to the scripts array of angular.json and added debug print-outs to understand what's going on.

The result is that it founds a needed element but after going through the list of them there's no recalc() calls or sticky_kit:stick events even if I specified recalculation per each second in the options.

Does anybody know what can be the reason of this behavior? Maybe, there's a tutorial how to add such scripts to an Angular projects?

Thanks in advance.

N-Nagorny commented 4 years ago

I figured out that if I call stick_in_parent() for a <div> in the main component, it works, but it doesn't for a <div> in the header component which is included in the main one with <app-header> selector.

N-Nagorny commented 3 years ago

parent: $("app-root") helped me. The issue can be closed.