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

Method _transitionCheckState

src/material/checkbox/checkbox.ts:368–397  ·  view source on GitHub ↗
(newState: TransitionCheckState)

Source from the content-addressed store, hash-verified

366 }
367
368 private _transitionCheckState(newState: TransitionCheckState) {
369 let oldState = this._currentCheckState;
370 let element = this._getAnimationTargetElement();
371
372 if (oldState === newState || !element) {
373 return;
374 }
375 if (this._currentAnimationClass) {
376 element.classList.remove(this._currentAnimationClass);
377 }
378
379 this._currentAnimationClass = this._getAnimationClassForCheckStateTransition(
380 oldState,
381 newState,
382 );
383 this._currentCheckState = newState;
384
385 if (this._currentAnimationClass.length > 0) {
386 element.classList.add(this._currentAnimationClass);
387
388 // Remove the animation class to avoid animation when the checkbox is moved between containers
389 const animationClass = this._currentAnimationClass;
390
391 this._ngZone.runOutsideAngular(() => {
392 setTimeout(() => {
393 element!.classList.remove(animationClass);
394 }, 1000);
395 });
396 }
397 }
398
399 private _emitChangeEvent() {
400 this._controlValueAccessorChangeFn(this.checked);

Callers 2

indeterminateMethod · 0.95
_handleInputClickMethod · 0.95

Calls 4

removeMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected