How to use the @angular/cdk/coercion.coerceNumberProperty 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 albertnadal / ng2-daterange-picker / node_modules / @angular / material / esm2015 / slider.js View on Github external
set step(v) {
        this._step = coerceNumberProperty(v, this._step);
        if (this._step % 1 !== 0) {
            this._roundLabelTo = /** @type {?} */ ((this._step.toString().split('.').pop())).length;
        }
        // Since this could modify the label, we need to notify the change detection.
        this._changeDetectorRef.markForCheck();
    }
    /**
github dynatrace-oss / barista / src / lib / formatters / bits / bits.ts View on Github external
transform(
    // tslint:disable-next-line:no-any
    input: any,
    factor: number = KILO_MULTIPLIER,
    inputUnit: DtUnit = DtUnit.BITS,
  ): DtFormattedValue | string {
    if (isEmpty(input)) {
      return NO_DATA;
    }
    if (input instanceof DtFormattedValue) {
      return formatBits(input, { factor, inputUnit });
    }
    if (isNumber(input)) {
      return formatBits(coerceNumberProperty(input), { factor, inputUnit });
    }

    return NO_DATA;
  }
}
github SchweizerischeBundesbahnen / scion-workbench / projects / app / workbench-application-platform / testing-app / src / app / testing / view-navigation-panel / view-navigation-panel.component.ts View on Github external
function coerceInsertionIndex(value: any): number | 'start' | 'end' | undefined {
  if (value === '') {
    return undefined;
  }
  if (value === 'start' || value === 'end' || value === undefined) {
    return value;
  }
  return coerceNumberProperty(value);
}
github angular / components / src / material / paginator / paginator.ts View on Github external
    this._pageSizeOptions = (value || []).map(p => coerceNumberProperty(p));
    this._updateDisplayedPageSizeOptions();
github swimlane / ngx-ui / projects / swimlane / ngx-ui / src / lib / components / select / select.component.ts View on Github external
set minSelections(minSelections) {
    this._minSelections = coerceNumberProperty(minSelections);
  }
github angular / components / src / material / sidenav / sidenav.ts View on Github external
  set fixedTopGap(value) { this._fixedTopGap = coerceNumberProperty(value); }
  private _fixedTopGap = 0;
github Teradata / covalent-nightly / esm5 / paging / paging-bar.component.js View on Github external
function (page) {
        if (page === 1 || (page >= 1 && page <= this.maxPage)) {
            this._page = coerceNumberProperty(Math.floor(page));
            this._handleOnChange();
            return true;
        }
        return false;
    };
    /**
github angular / components / src / lib / grid-list / grid-tile.ts View on Github external
  set rowspan(value: number) { this._rowspan = Math.round(coerceNumberProperty(value)); }
github angular / components / src / material / grid-list / grid-tile.ts View on Github external
  set colspan(value: number) { this._colspan = Math.round(coerceNumberProperty(value)); }
github DSI-HUG / dejajs-components / src / component / splitter / split-gutter.directive.ts View on Github external
public set size(v: number | string) {
        this.setStyle('flex-basis', `${coerceNumberProperty(v)}px`);
    }