ScrollTrigger progress
ng-gsap/scroll-trigger
injectScrollTrigger mirrors a ScrollTrigger's progress, isActive, and direction as signals. Scroll the panel below โ the bar and the label are just reading signals, no manual DOM writes and nothing to unsubscribe on destroy.
progress: 0% ยท active: false
panel 1
panel 2
panel 3
panel 4
private section = viewChild.required<ElementRef>('section');
protected scrollTrigger = injectScrollTrigger({
trigger: this.section,
start: 'top top',
end: 'bottom bottom',
scrub: true,
});
// scrollTrigger.progress() / .isActive() are plain signals โ no subscription to tear down