import { Component, OnInit } from '@angular/core';

import { SchoolData } from '../../../structures/school-data';

import { SchoolService } from 'src/app/services/school.service';

import * as Globals from '../../../globals';

@Component({
  selector: 'app-all-schools-page',
  templateUrl: './all-schools-page.component.html',
  styleUrls: ['./all-schools-page.component.scss']
})
export class AllSchoolsPageComponent implements OnInit {

  title = Globals.pages.allSchools.text;

  allSchools: SchoolData[] | null = null;

  constructor(private schoolService: SchoolService) { 
    this.schoolService.allSchools$.subscribe((data: SchoolData[] | null) => {
      this.allSchools = data;
    })
    this.schoolService.actualizeAllSchools(); 
  }

  ngOnInit(): void {
  }

}
