-1
I’m using Mongodb’s data bank. I believe that most understand that to update a record it is of utmost importance to take the key identifier, ie the _id, I am managed to get the registry identifier key by doing so;
ngOnInit() {
const codigoLancamento = this._route.snapshot.params['id'];
}
But I have no idea how my method will receive this record through the method below;
onSubmit(){
var id;
this._restaurantAdminService.editRestaurant( id , this.restaurant).subscribe(
response => {
if(!response.restaurant) {
this.status = 'error';
} else {
this.status = 'success';
this.restaurant = response.restaurant;
}
},
error => {
var errorMessage = <any>error;
if(errorMessage != null){
this.status = 'error';
}
}
);
}
I’m open to any questions you need to help me solve this problem.
Try this.codeLanking = this. _route.snapshot.params['id'];
– Eduardo Vargas
Ai in onsubmit(){ const id=this.codeLancameto;
– Eduardo Vargas
I would like to know who is chasing me and notifying my posts with negative as it is up there on top, that son of a bitch not to say otherwise.
– wladyband