w11k / angular-sticky-things

Sticky Directive for Angular 2+

Home Page:https://w11k.github.io/angular-sticky-things

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature request: @output event?

taivu opened this issue · comments

commented

this is a feature request. It would be nice to have an event emitted so once something is 'sticky-ed', we can do something programmatically to react to it (showing a notification or getting data, etc).

thanks for your time.

@taivu I made a pull request for this as I needed this feature too #38

@taivu @CapitanFindusFI just updated to v.1.1.8. your are now able to listen for events named

  • "stickyStatus" and
  • "stickyPosition"

the following picture shows the available attributes of the events. first object shows attributes from the sticky position event, the second from sticky status.

Bildschirmfoto 2019-10-24 um 17 48 59

the attributes

  • marginTop and
  • marginBottom

from sticky position can be set via property binding on the sticky component. if you need the events for styling the css classes

  • .is-sticky and
  • .boundary-reached

are set accordingly to the sticky status.

thanks for your patience. hope this helps.