42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import {ActivitiesService} from '@app/Services/activities.service';
|
|
import {ScheduleService} from '@app/Services/schedule.service';
|
|
import {ScheduleComponent} from '@app/schedule/schedule.component';
|
|
import {MatDialog} from '@angular/material';
|
|
import {NewScheduleComponent} from '@app/new-schedule/new-schedule.component';
|
|
|
|
@Component({
|
|
selector: 'app-activities',
|
|
templateUrl: './activities.component.html',
|
|
styleUrls: ['./activities.component.css']
|
|
})
|
|
export class ActivitiesComponent implements OnInit {
|
|
|
|
activities: any[];
|
|
schedule = {
|
|
activitiesId: '',
|
|
};
|
|
|
|
animal: string;
|
|
name: string;
|
|
|
|
constructor(private activitiesService: ActivitiesService,
|
|
private scheduleService: ScheduleService,
|
|
public dialog: MatDialog) {
|
|
}
|
|
|
|
ngOnInit() {
|
|
this.activitiesService.getActivities().subscribe(data => {
|
|
this.activities = data.map(e => {
|
|
return {
|
|
id: e.payload.doc.id,
|
|
data: e.payload.doc.data()
|
|
} as any;
|
|
});
|
|
});
|
|
}
|
|
|
|
addActivitiesIntoSchedule(id) {
|
|
}
|
|
}
|