How to use the @delon/util.toBoolean function in @delon/util

To help you get started, we’ve selected a few @delon/util 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 ng-alain / delon / packages / abc / standard-form-row / standard-form-row.component.ts View on Github external
set block(value: any) {
    this._block = toBoolean(value);
  }
  private _block: boolean;
github ng-alain / delon / packages / abc / standard-form-row / standard-form-row.component.ts View on Github external
set last(value: any) {
    this._last = toBoolean(value);
  }
  private _last: boolean;
github ng-alain / delon / packages / abc / table / table.component.ts View on Github external
set multiSort(value: any) {
    if (typeof value === 'boolean' && !toBoolean(value)) {
      this._multiSort = null;
      return;
    }
    this._multiSort = {
      ...(typeof value === 'object' ? value : {}),
    };
  }
  @Input()
github ng-alain / delon / packages / abc / table / table.component.ts View on Github external
set page(value: STPage) {
    this.clonePage = value;
    const item = deepMergeKey({}, true, new STConfig().page, this.cog.page, value);
    const { total } = item;
    if (typeof total === 'string' && total.length) {
      this.totalTpl = total;
    } else if (toBoolean(total)) {
      this.totalTpl = this.locale.total;
    } else {
      this.totalTpl = '';
    }
    this._page = item;
  }
  /** 是否多排序,当 `sort` 多个相同值时自动合并,建议后端支持时使用 */
github ng-alain / delon / packages / abc / standard-form-row / standard-form-row.component.ts View on Github external
set grid(value: any) {
    this._grid = toBoolean(value);
  }
  private _grid: boolean;
github ng-alain / delon / packages / abc / desc-list / desc-list-item.component.ts View on Github external
set noDefault(value: any) {
    this._noDefault = toBoolean(value);
  }
  private _noDefault = false;
github ng-alain / delon / packages / form / src / utils.ts View on Github external
export function toBool(value: any, defaultValue: boolean) {
  value = toBoolean(value, true);
  return value == null ? defaultValue : value;
}