--- title: Angular Virtual --- The `@tanstack/angular-virtual` adapter is a wrapper around the core virtual logic. Angular Virtual supports Angular 19 and newer. In practice, the adapter is intended to support Angular LTS releases and newer. ## `injectVirtualizer` ```ts function injectVirtualizer( options: PartialKeys< Omit, 'getScrollElement'>, 'observeElementRect' | 'observeElementOffset' | 'scrollToFn' > & { scrollElement: ElementRef | TScrollElement | undefined }, ): AngularVirtualizer ``` This function returns an `AngularVirtualizer` instance configured to work with an HTML element as the scrollElement. The returned `AngularVirtualizer` mirrors the core `Virtualizer`, but adapter-managed state is exposed through Angular signals. This includes: - `getTotalSize` - `getVirtualItems` - `isScrolling` - `options` - `range` - `scrollDirection` - `scrollElement` - `scrollOffset` - `scrollRect` - `measurementsCache` ## `injectWindowVirtualizer` ```ts function injectWindowVirtualizer( options: PartialKeys< VirtualizerOptions, | 'getScrollElement' | 'observeElementRect' | 'observeElementOffset' | 'scrollToFn' >, ): AngularVirtualizer ``` This function returns a window-based `AngularVirtualizer` instance configured to work with the window as the scrollElement.