Skip to content

Latest commit

 

History

History
337 lines (221 loc) · 5.05 KB

boolean.md

File metadata and controls

337 lines (221 loc) · 5.05 KB

Boolean

You can check the module import here.

greater

Returns true if the first value is greater than the second value.

File
import { IsGreaterPipe } from 'angular-pipes';
Usage
{{ 0 | greater: 1 }} <!-- false -->
{{ 1 | greater: 0 }} <!-- true -->
{{ 1 | greater: 1 }} <!-- false -->

greaterOrEqual

Returns true if the first value is greater or equal to the second value.

File
import { IsGreaterOrEqualPipe } from 'angular-pipes';
Usage
{{ 0 | greaterOrEqual: 1 }} <!-- false -->
{{ 1 | greaterOrEqual: 0 }} <!-- true -->
{{ 1 | greaterOrEqual: 1 }} <!-- true -->

less

Returns true if the first value is less than the second value.

File
import { IsLessPipe } from 'angular-pipes';
Usage
{{ 0 | less: 1 }} <!-- true -->
{{ 1 | less: 0 }} <!-- false -->
{{ 1 | less: 1 }} <!-- false -->

lessOrEqual

Returns true if the first value is less or equal to the second value.

File
import { IsLessOrEqualPipe } from 'angular-pipes';
Usage
{{ 0 | lessOrEqual: 1 }} <!-- true -->
{{ 1 | lessOrEqual: 0 }} <!-- false -->
{{ 1 | lessOrEqual: 1 }} <!-- true -->

equal

Returns true if the value are equal (operator ==).

File
import { IsEqualPipe } from 'angular-pipes';
Usage
{{ 0 | equal: 1 }} <!-- false -->
{{ 1 | equal: '1' }} <!-- true -->
{{ 1 | equal: 1 }} <!-- true -->

notEqual

Returns true if the value are not equal (operator !=).

File
import { IsNotEqualPipe } from 'angular-pipes';
Usage
{{ 0 | notEqual: 1 }} <!-- true -->
{{ 1 | notEqual: '1' }} <!-- false -->
{{ 1 | notEqual: 1 }} <!-- false -->

identical

Returns true if the value are identical (operator ===).

File
import { IsIdenticalPipe } from 'angular-pipes';
Usage
{{ 0 | identical: 1 }} <!-- false -->
{{ 1 | identical: '1' }} <!-- false -->
{{ 1 | identical: 1 }} <!-- true -->

notIdentical

Returns true if the value are not identical (operator !==).

File
import { IsNotIdenticalPipe } from 'angular-pipes';
Usage
{{ 0 | notIdentical: 1 }} <!-- true -->
{{ 1 | notIdentical: '1' }} <!-- true -->
{{ 1 | notIdentical: 1 }} <!-- false -->

isNull

Returns true if the value if null.

File
import { IsNullPipe } from 'angular-pipes';
Usage
{{ null | isNull }} <!-- true -->
{{ 1 | isNull }} <!-- false -->

isUndefined

Returns true if the value if undefined.

File
import { IsUndefinedPipe } from 'angular-pipes';
Usage
{{ a | isUndefined }} <!-- true if a does not exists -->
{{ 1 | isUndefined }} <!-- false -->

isNil

Returns true if the value if null or undefined.

File
import { IsNilPipe } from 'angular-pipes';
Usage
{{ a | isNil }} <!-- true if a does not exists -->
{{ null | isNil }} <!-- true -->
{{ 1 | isNil }} <!-- false -->

isNumber

Returns true if the value is a number.

File
import { IsNumberPipe } from 'angular-pipes';
Usage
{{ 'a' | isNumber }} <!-- false -->
{{ 1 | isNumber }} <!-- true -->

isString

Returns true if the value is a string.

File
import { IsStringPipe } from 'angular-pipes';
Usage
{{ 'a' | isString }} <!-- true -->
{{ 1 | isString }} <!-- false -->

isFunction

Returns true if the value is a function.

File
import { IsFunctionPipe } from 'angular-pipes';
Usage
myFn() {
    // ...
}
{{ 'a' | isFunction }} <!-- false -->
{{ myFn | isFunction }} <!-- true -->

isArray

Returns true if the value is an array.

File
import { IsArrayPipe } from 'angular-pipes';
Usage
{{ 'a' | isArray }} <!-- false -->
{{ [] | isArray }} <!-- true -->

isObject

Returns true if the value is an object.

File
import { IsObjectPipe } from 'angular-pipes';
Usage
{{ 'a' | isObject }} <!-- false -->
{{ {} | isObject }} <!-- true -->

isDefined

Returns true if the value is defined (nor null nor undefined).

File
import { IsDefinedPipe } from 'angular-pipes';
Usage
{{ 'a' | isDefined }} <!-- true -->
{{ null | isDefined }} <!-- false -->
{{ a | isDefined }} <!-- false if a does not exists -->