After weeks of searching on Google and just one question with Stackoverflow, I finally managed to build my Angular CRUD application using the Material Table component . It shows data from the backend (JSON) and for CRUD operations I use dialogs similar to the one shown in the picture (this is editing, sorry for Croatian). Dialogs may not be the best way, inline editing may be better. But still, to add a new element you need something like a dialog.

The last thing I'm stuck with is how to update the fields in the table accordingly. Therefore, when you click "Save" in the dialog box, the data is updated in the backend (in the MySQL table), and not in the external one. I currently have a disgusting workaround for this, every time you do an update, it updates the whole table as well.
Anyway, here is the code:
Table Component:
export class BazaComponent implements OnInit { .... constructor(public httpClient: HttpClient, public dialog: MatDialog) { } ngOnInit() { this.loadData(); }
Here is the DataService where I think I should do field updates:
import { Injectable } from '@angular/core'; import { HttpClient, HttpErrorResponse, HttpHeaders} from '@angular/common/http'; import { Baza } from '../models/kanban.baza'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; @Injectable() export class DataService { private readonly API_URL = 'http://localhost/api/' dataChange: BehaviorSubject<Baza[]> = new BehaviorSubject<Baza[]>([]); constructor(private httpClient: HttpClient) { } get data(): Baza[] { return this.dataChange.value; } getAllItems(): void { this.httpClient.get<Baza[]>(this.API_URL).subscribe(data => { this.dataChange.next(data['items']); }); } addItem(baza: Baza): void { this.httpClient.post(this.API_URL, Baza).subscribe(data => {
UPDATE 11/27/2017:
Ok, I finally figured out how to cause a newline to be added. I had to call dataChange.value inside the table component. As soon as you load it with some data, a new line will appear instantly.
const data = {id: 208, ident: 233, naziv: 'test', mt: 291, komada: 2, jm: 'a', orginal: 100, lokacija: 3, napomena: 'pls work'}; this.exampleDatabase.dataChange.value.push(data);
The same thing in a DataService will not work:
this.dataChange.value.push(data);
The plunker is here:
https://plnkr.co/edit/IWCVsBRl54F7ylGNIJJ3?p=info
EDIT 11/28/2017:
Now it remains only to build the logic for adding, editing and deleting. Adding is simple, it's just "value.push (data)". Thanks for helping everyone.