This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum VisibilityState { | |
Visible = 'visible', | |
Hidden = 'hidden' | |
} | |
enum Direction { | |
Up = 'Up', | |
Down = 'Down' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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( |