A warning message shows up when a for loop is used inside of a subscription (when I delete the for loop, the warning dissapear). I was trying to convert a Timestamp from SQL into a number readable for angular, i find a workaround but a warning appears
import { stringify } from '@angular/compiler/src/util';
getUserTasks() {
this.tasksSubscription = this.userService.getUserTasks(3).subscribe(tasks => {
this.tasks = tasks;
for (var ta of this.tasks) {
let str = ta.startDate.split("[");
let time = new Date(str[0]);
ta.startDate = stringify(time.getTime());
}
this.TaskDataSource.data = this.tasks;
this.isLoading = false;
}
);
}
WARNING :
WARNING in ./node_modules/@angular/compiler/src/util.js 10:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted