Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Latest commit

 

History

History
370 lines (265 loc) · 5.17 KB

boolean.md

File metadata and controls

370 lines (265 loc) · 5.17 KB

Boolean

You can check the module import here.

greater

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

File
import { NgIsGreaterPipeModule } 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 { NgIsGreaterOrEqualPipeModule } 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 { NgIsLessPipeModule } 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 { NgIsLessOrEqualPipeModule } 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 { NgIsEqualPipeModule } 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 { NgIsNotEqualPipeModule } 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 { NgIsIdenticalPipeModule } 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 { NgIsNotIdenticalPipeModule } 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 { NgIsNullPipeModule } from 'angular-pipes';
Usage
{{ null | isNull }}
<!-- true -->
{{ 1 | isNull }}
<!-- false -->

isUndefined

Returns true if the value if undefined.

File
import { NgIsUndefinedPipeModule } 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 { NgIsNilPipeModule } 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 { NgIsNumberPipeModule } from 'angular-pipes';
Usage
{{ 'a' | isNumber }}
<!-- false -->
{{ 1 | isNumber }}
<!-- true -->

isString

Returns true if the value is a string.

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

isFunction

Returns true if the value is a function.

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

isArray

Returns true if the value is an array.

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

isObject

Returns true if the value is an object.

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

isDefined

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

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