Commit 7afea454 authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

Boilerplate list

parent 04fa07be
......@@ -10,8 +10,7 @@ export interface PeriodicElement {
has_main: boolean;
has_suffix: boolean;
}
const ELEMENT_DATA: PeriodicElement[] = [{id: 5, title:"ss", has_prefix: false, has_main:true, has_suffix:true},
{id: 6, title:"s222s", has_prefix: false, has_main:true, has_suffix:true}];
const ELEMENT_DATA: Boilerplate[] = [{}];
@Component({
selector: 'app-boilerplate-list',
......@@ -26,7 +25,7 @@ export class BoilerplateListComponent implements OnInit {
currentIndex = -1;
title = '';
displayedColumns: string[] = ['id', 'title', 'has_prefix', 'has_main', 'has_suffix'];
dataSource = [{}]; //ELEMENT_DATA;
dataSource :Boilerplate[] = [{}];
constructor(private boilerplateService: BoilerplateService) { }
......@@ -35,18 +34,18 @@ export class BoilerplateListComponent implements OnInit {
}
retrieveBoilerplates(): void {
this.dataSource = [{}];
// this.dataSource = this.boilerplates
this.boilerplateService.getAll()
.subscribe(
data => {
this.boilerplates = data;
//this.boilerplates = this.dataSource;
data.forEach(val => this.dataSource.push(Object.assign(val)));
this.dataSource = data;
console.log(this.dataSource);
},
error => {
console.log(error);
});
}
refreshList(): void {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment