MCPcopy Create free account
hub / github.com/angular/components / getSliderValue

Function getSliderValue

src/material/slider/slider.e2e.spec.ts:113–118  ·  view source on GitHub ↗

Returns the current value of the slider.

(slider: ElementFinder, thumbPosition: Thumb)

Source from the content-addressed store, hash-verified

111
112/** Returns the current value of the slider. */
113async function getSliderValue(slider: ElementFinder, thumbPosition: Thumb): Promise<number> {
114 const inputs = await slider.all(by.css('.mdc-slider__input'));
115 return thumbPosition === Thumb.END
116 ? Number(await inputs[inputs.length - 1].getAttribute('value'))
117 : Number(await inputs[0].getAttribute('value'));
118}
119
120/** Focuses on the MatSlider at the coordinates corresponding to the given thumb. */
121async function focusSliderThumb(slider: ElementFinder, thumbPosition: Thumb): Promise<void> {

Callers 3

slider.e2e.spec.tsFile · 0.85
focusSliderThumbFunction · 0.85
slideToValueFunction · 0.85

Calls 1

getAttributeMethod · 0.65

Tested by

no test coverage detected