Skip to content

Instantly share code, notes, and snippets.

enum VisibilityState {
Visible = 'visible',
Hidden = 'hidden'
}
enum Direction {
Up = 'Up',
Down = 'Down'
}
@Component({
selector: 'app-sticky-header',
template: `<ng-content></ng-content>`,
styles: [ ... ]
})
export class StickyHeaderComponent implements AfterViewInit {
private isVisible = true;
ngAfterViewInit() {
const scroll$ = fromEvent(window, 'scroll').pipe(