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

Function _validateInputs

src/material/slider/slider.ts:952–966  ·  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

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

Callers 1

ngAfterViewInitMethod · 0.85

Tested by

no test coverage detected