packages/ui/src/lib/form/max-items.pipe.ts
This pipe slices an array after the nth item
Name | maxItems |
transform | ||||||||||||||||
transform(array: Array
|
||||||||||||||||
Defined in packages/ui/src/lib/form/max-items.pipe.ts:7
|
||||||||||||||||
Parameters :
Returns :
any
|
import { Pipe, PipeTransform } from '@angular/core';
/** This pipe slices an array after the nth item */
@Pipe({
name: 'maxItems',
})
export class MaxItemsPipe implements PipeTransform {
transform(array: Array<any> = [], maxItems: number, start: number = 0): any {
return array.slice(start, maxItems);
}
}