import { Component, OnInit } from '@angular/core';
import { Organization } from 'src/app/models/organization';
import { OrganizationsService } from 'src/app/services/organizations.service';
import { RouterModule } from '@angular/router';

@Component({
  selector: 'app-organization-cards',
  templateUrl: './organization-cards.component.html',
  styleUrls: ['./organization-cards.component.scss']
})
export class OrganizationCardsComponent implements OnInit {
  
  listOrganizations:any;
  error:boolean = false;
  errorMessage:string;

  constructor(private orgService: OrganizationsService) { }

  ngOnInit() {

    //});
    this.orgService.getOrganizations().subscribe((res)=>{
      this.listOrganizations = res["organizations"];
    },
    (err) => {
      this.error = true;
      this.errorMessage = err.message;
    });
      

  }


  
}
