ng-utils-pack v1.0.3
#Angular directives and pipes pack
##Installation
npm i ng-utils-pack
and
import { NgUtilsModule } from 'ng-utils-pack'
or
import { SingleElement } from 'ng-utils-pack'
##Directives
###OnlyNumber
Numerical formatter for input. Allowed: numbers (numpad to), space, '+', Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+X, home, end, left and right.
Usage:
[OnlyNumber]="true"
##Pipes
###EnumToArrayPipe
Convert enumerator to array.
Usage:
*ngFor="let element of elements | enumToArray"
###MomentPipe
Return the date in the format provided. Parameters: string = date format.
Usage:
string | moment: 'DD/MM/YYYY'
###OrderByPipe
Sort array in *ngFor. Parameters: string[] = properties to sort.
Usage:
*ngFor="let element of elements | orderBy: ['element.firstProperty', 'element.secondProperty']"
###TextTruncatePipe
Return truncated string. Parameter: number = string length.
Usage:
string | truncate: 450