Comments (3)
Please take a look at (especially commented part):
https://github.com/marinantonio/angular-mat-table-crud/blob/master/src/app/services/data.service.ts
We're using httpClient's error handling, HttpErrorResponse
, so once you call one of the methods httpClient will tick error if it happened. It has nothing to do with dialog. Etc. PUT method:
updateItem(kanbanItem: KanbanItem): void {
this.httpClient.put(this.API_URL + kanbanItem.id, kanbanItem).subscribe(data => {
this.dialogData = kanbanItem;
console.log('Successuful, all fine');
},
(err: HttpErrorResponse) => {
console.log('Error occurred. Details: ' + err.name + ' ' + err.message);
}
);
from angular-mat-table-crud.
Hi @marinantonio and thanks for pointing this out. I tried this but now I stuck on dialogData variable.
I use angular/material:5.2.4. Behaviour of that version make that piece of code not work as expected.
It seems dialog is already closed but dataService has not yet finished - so push bellow gets wrong (old) value stored in dialogData
For add we're just pushing a new row inside DataService
this.exampleDatabase.dataChange.value.push(this.dataService.getDialogData() );
gets dialogData before
addItem(kanbanItem: SubscriptionDto): void {
this.serviceProxy.create(kanbanItem).subscribe((result) => {
===>>>> this.dialogData = result; <<<<<=====
this.toasterService.showToaster('Successfully added', 3000);
}, err => {
this.toasterService.showToaster('Error occurred. Details: ' + err.name + ' ' + err.message, 8000);
});
}
from angular-mat-table-crud.
I've updated to latest material and I'm still unable to reproduce your issues. What I see from your snippet you're using serviceProxy
? HttpClient uses HTTP Methods (POST, PUT, DELETE), so I'm not sure about create method? Also you might want to check backend response once operation passes. HttpClient
usually expects some response and can break if there's none.
from angular-mat-table-crud.
Related Issues (20)
- Reading data from JSON - Beyond CRUD HOT 3
- edit component cannot be bootstraped
- Table Refresh HOT 1
- Help for dummy HOT 1
- Is this project updated with latest angular version i.e. angular? HOT 7
- Need Licensing details HOT 1
- Edit & Delete not works HOT 2
- Filter throws exception after adding an issue. HOT 2
- this.filter undefined HOT 1
- How to run/setup this app ? HOT 1
- Issue with Angular 8 loading HOT 1
- image upload HOT 2
- Can we use MatTableDataSource in your example? HOT 2
- paginator adding firstlastbutton and page
- addNew() HOT 2
- Tutorial HOT 1
- show toaster notifications HOT 1
- [FEATURE] change detection on push HOT 1
- How to export table's data to csv , excel , doc and pdf HOT 1
- need help HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-mat-table-crud.