How to use the @angular/cdk/coercion.coerceBooleanProperty function in @angular/cdk

To help you get started, we’ve selected a few @angular/cdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / components / src / lib / radio / radio.ts View on Github external
set checked(value: boolean) {
    const newCheckedState = coerceBooleanProperty(value);
    if (this._checked !== newCheckedState) {
      this._checked = newCheckedState;
      if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {
        this.radioGroup.selected = this;
      } else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {

        // When unchecking the selected radio button, update the selected radio
        // property on the group.
        this.radioGroup.selected = null;
      }

      if (newCheckedState) {
        // Notify all radio buttons with the same name to un-check.
        this._radioDispatcher.notify(this.id, this.name);
      }
      this._changeDetector.markForCheck();
github angular / components / src / material / checkbox / testing / checkbox-harness.ts View on Github external
async isChecked(): Promise {
    const checked = (await this._input()).getProperty('checked');
    return coerceBooleanProperty(await checked);
  }
github Teradata / covalent-nightly / fesm5 / covalent-core-expansion-panel.js View on Github external
function (expand) {
            this._setExpand(coerceBooleanProperty(expand));
        },
        enumerable: true,
github trimox / angular-mdc-web / packages / chips / chip.ts View on Github external
set disableRipple(value: boolean) {
    this._disableRipple = coerceBooleanProperty(value);
  }
  private _disableRipple: boolean = false;
github trimox / angular-mdc-web / packages / top-app-bar / top-app-bar.ts View on Github external
setShort(short: boolean, isUserInput: boolean = false): void {
    this._short = coerceBooleanProperty(short);

    if (this.short) {
      this.setProminent(false);
      this.setDense(false);
      this.setFixed(false);
    } else {
      this.setShortCollapsed(false);
    }

    if (isUserInput) {
      this._initFoundation();
    }
  }
github ncstate-sat / popover / src / lib / popover / popover.component.ts View on Github external
set interactiveClose(val: boolean) {
    this._interactiveClose = coerceBooleanProperty(val);
  }
  private _interactiveClose = true;
github sbb-design-systems / sbb-angular / projects / sbb-esta / angular-public / select / src / select / select.component.ts View on Github external
set required(value: boolean) {
    this._required = coerceBooleanProperty(value);
    this.stateChanges.next();
  }
github DSI-HUG / dejajs-components / src / component / content-editable / content-editable.directive.ts View on Github external
public set disabled(value: boolean | string) {
        const disabled = coerceBooleanProperty(value);
        this._disabled = disabled || null;
        if (this.disabled) {
            this.edit$.next([false, false]);
        }
    }
github dynatrace-oss / barista / components / core / src / option / option.ts View on Github external
set disabled(value: boolean) {
    this._disabled = coerceBooleanProperty(value);
  }