Ich habe folgendes ObjektAngular 2 - Holen Sie sich eine Eigenschaft des Objekts in einem Array
export class HourPerMonth {
constructor(
public year_month: string,
public hours: string,
public amount: string
) { };
}
Jetzt i mit einem Array füllen wollen nur die Stunden vom Objekt.
private hourPerMonth: HourPerMonth[];
private hoursArray: Array<any>;
getChartData() {
this.chartService.getHoursPerMonth().subscribe(source => {
this.hourPerMonth = source;
this.hoursArray = ?
});
}
Wie bekomme ich die Stunden vom Objekt in die StundenArray?