Warm tip: This article is reproduced from stackoverflow.com, please click
angular

How to read *ngFor data into the component

发布于 2020-03-27 10:20:10

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

Questioner
Dato Gogshelidze
Viewed
96
indrajeet 2019-07-03 22:01

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

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

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