My component looks like this :
import { Component, OnInit } from '@angular/core';
import { Member} from '../entities/Member';
import { SearchService } from './search.service';
@Component({
selector: 'app-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.scss']})
export class SearchComponent implements OnInit {
members: Member[] = [];
constructor(private searchService: SearchService) { }
ngOnInit() {
this.searchService.getPartenaires().subscribe(
member=> {
this.members= member;
}
);
}
}
I haven't figured out how to display my objects on a material table using ngFor
. the examples on https://material.angular.io/components/table/overview are always using arrays as DataSource.
Should I put my objects into an array before passing them to the HTML? or is there a way to loop through them? thanks.