MCPcopy
hub / github.com/angular/components / _transitionCheckState

Method _transitionCheckState

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

Source from the content-addressed store, hash-verified

358 }
359
360 private _transitionCheckState(newState: TransitionCheckState) {
361 let oldState = this._currentCheckState;
362 let element = this._getAnimationTargetElement();
363
364 if (oldState === newState || !element) {
365 return;
366 }
367 if (this._currentAnimationClass) {
368 element.classList.remove(this._currentAnimationClass);
369 }
370
371 this._currentAnimationClass = this._getAnimationClassForCheckStateTransition(
372 oldState,
373 newState,
374 );
375 this._currentCheckState = newState;
376
377 if (this._currentAnimationClass.length > 0) {
378 element.classList.add(this._currentAnimationClass);
379
380 // Remove the animation class to avoid animation when the checkbox is moved between containers
381 const animationClass = this._currentAnimationClass;
382
383 this._ngZone.runOutsideAngular(() => {
384 setTimeout(() => {
385 element!.classList.remove(animationClass);
386 }, 1000);
387 });
388 }
389 }
390
391 private _emitChangeEvent() {
392 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