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

Function _validateInputs

src/material/slider/slider.ts:949–963  ·  view source on GitHub ↗

Ensures that there is not an invalid configuration for the slider thumb inputs.

(
  isRange: boolean,
  endInputElement: _MatSliderThumb | _MatSliderRangeThumb | undefined,
  startInputElement: _MatSliderThumb | undefined,
)

Source from the content-addressed store, hash-verified

947
948/** Ensures that there is not an invalid configuration for the slider thumb inputs. */
949function _validateInputs(
950 isRange: boolean,
951 endInputElement: _MatSliderThumb | _MatSliderRangeThumb | undefined,
952 startInputElement: _MatSliderThumb | undefined,
953): void {
954 const startValid =
955 !isRange || startInputElement?._hostElement.hasAttribute('matSliderStartThumb');
956 const endValid = endInputElement?._hostElement.hasAttribute(
957 isRange ? 'matSliderEndThumb' : 'matSliderThumb',
958 );
959
960 if (!startValid || !endValid) {
961 _throwInvalidInputConfigurationError();
962 }
963}
964
965function _throwInvalidInputConfigurationError(): void {
966 throw Error(`Invalid slider thumb input configuration!

Callers 1

ngAfterViewInitMethod · 0.85

Tested by

no test coverage detected