Dato Gogshelidze
Dato Gogshelidze

Reputation: 746

How to read *ngFor data into the component

I want to read *ngFor data into the component. I am using pipes into *ngFor(*cdkVirtualFor) and I can not include this pipes into component. Also, array are complex and I need simply read *ngFor array from template to component. My code:

<div
    *cdkVirtualFor="let item of (items | pipeOne : pipeOneData | pipeTwo : pipeTwoData1 : pipeTwoData2 | pipethree | pipefour)"> 
</div>

I need this data into the component (.ts) file.

Thank you in addition

Upvotes: 0

Views: 98

Answers (1)

indrajeet
indrajeet

Reputation: 897

import all your pipes in component and apply pipe in component -

import { pipeOne } from './pipeone.pipe';

const transformedItems = new pipeOne().transform(this.items);

Upvotes: 3

Related Questions