Angular LMS app
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
Це архівний репозитарій. Ви можете переглядати і клонувати файли, але не можете робити пуш або відкривати питання/запити.
 
 
 
 

46 рядки
1.3 KiB

  1. import { Component, OnInit } from '@angular/core';
  2. import { Location } from '@angular/common';
  3. import { DemoService } from '../services/demo.service';
  4. @Component({
  5. selector: 'app-attendance',
  6. templateUrl: './attendance.component.html',
  7. styleUrls: ['./attendance.component.scss']
  8. })
  9. export class AttendanceComponent implements OnInit {
  10. selectedList: number = 1;
  11. selectedSegment: any;
  12. selectedSegmentTab: any;
  13. selectedReportYear: any;
  14. demoType: string;
  15. attendanceList = [];
  16. constructor(
  17. private location: Location,
  18. private demoService: DemoService
  19. ) { }
  20. ngOnInit(): void {
  21. this.demoType = localStorage.demoType;
  22. this.attendanceList = this.demoService.attendanceList;
  23. if (this.demoType === 'Teacher') {
  24. this.selectedList = 1;
  25. this.selectedSegment = this.attendanceList[0];
  26. this.selectedSegmentTab = this.attendanceList[0].subjects[0];
  27. this.selectedReportYear = this.attendanceList[0].subjects[0].attendance[0].year;
  28. } else {
  29. this.selectedList = 1;
  30. this.selectedSegment = 'ALL';
  31. this.selectedSegmentTab = 'report';
  32. this.selectedReportYear = 2020;
  33. }
  34. }
  35. back() {
  36. this.location.back();
  37. }
  38. }