@angular-ru/cdk/utils

  • detectChanges(cds: ChangeDetectorRef | ChangeDetectorRef[]) - run detect changes if view reference not destroyed.

  • downloadFile(file: FileToDownloadInfo) - download file setting source(Blob or File), name and extension (such as 'xls', 'txt' etc.).

  • $any(val)

import {$any} from '@angular-ru/cdk/utils';

const left: number | string | null = '12';
const result: boolean = $any(left) > 13;
  • $cast(val)

import {$cast} from '@angular-ru/cdk/utils';

const left: number | string | null = '12';
const result: boolean = $cast<number>(left) > 13;
  • isNill

import {isNil} from '@angular-ru/cdk/utils';

expect(isNil(null)).toEqual(true);
expect(isNil(undefined)).toEqual(true);
expect(isNil('')).toEqual(false);
expect(isNil(0)).toEqual(false);
  • isNotNil

  • checkValueIsEmpty

  • checkValueIsFilled

  • checkSomeValueIsEmpty

  • checkEveryValueIsEmpty

  • checkSomeValueIsTrue

  • checkSomeValueIsFalse

  • checkEveryValueIsTrue

  • checkEveryValueIsFalse

  • checkEveryValueIsFilled

  • isIE

  • getBodyRect

  • copyString

  • copyHtml

  • parseXmlFromString

  • serializeXmlToString

  • isBoolean

  • isTrue, isFalse

  • isTruthy, isFalsy

  • tryParseJson

  • filter

  • fallbackIfEmpty

  • replaceUnits

Last updated