MCPcopy Create free account
hub / github.com/ReactiveX/rxjs / scroll

Method scroll

apps/rxjs.dev/src/app/shared/scroll.service.ts:83–89  ·  view source on GitHub ↗

* Scroll to the element with id extracted from the current location hash fragment. * Scroll to top if no hash. * Don't scroll if hash not found.

()

Source from the content-addressed store, hash-verified

81 * Don't scroll if hash not found.
82 */
83 scroll() {
84 const hash = this.getCurrentHash();
85 const element: HTMLElement = hash
86 ? this.document.getElementById(hash)
87 : this.topOfPageElement;
88 this.scrollToElement(element);
89 }
90
91 /**
92 * test if the current location has a hash

Callers 3

scrollAfterRenderMethod · 0.95
ngOnInitMethod · 0.80

Calls 2

getCurrentHashMethod · 0.95
scrollToElementMethod · 0.95

Tested by

no test coverage detected