i use angular 6 and rxjs.
i define data1 as a list of array.
let interestingFields = [ 'traitement','datedebut', 'datefin'];
this.ppssToDisplay.subscribe(ppsList => {
this.data1 = [
interestingFields,
...ppsList.map(pps => interestingFields.map(field => pps[field]))
];
console.log(this.data1);
});
But i must use data1 out the fonction;`
i try this.data2 = this.data1;
But it doesn't work
console.log(this.data1); pps.component.ts:71 (4) [Array(3), Array(3), Array(3), Array(3)]
console.log(this.data2); undefined
How i can do ?