0

When I update, I have the error above. Help me please

He are my codes :

1° my classe.component.ts :

onUpdateCla(data){ console.log(data); this.classeService.postRessource(this.currentClasse._links.classe.href,data) .subscribe(data=>{ this.mode='list'; this.onGetAllClasses(); }, err=>{ console.log(err); }); } 

and my classe.component.html :

 <form #f="ngForm" (ngSubmit)="onUpdateCla(f.value)"> <div class="form-group"> <label class="control-label">Nom classe</label> <input type="text" name="nomClasse" ngModel class="form-control" [(ngModel)]="currentClasse.nomClasse"> </div> <div class="form-group"> NIVEAU <label >Nivaux</label> <select name="niveau" [(ngModel)]="listNiveaux.niveau" class="form-control"> <option *ngFor="let niv of listNiveaux?._embedded?.niveaus" [value]="niv.id"> {{niv.nomNiveau}} </option> </select> </div> <button class="btn btn-success" type="submit">Mettre à jour</button> </form> 
4
  • 404 means that the url is not found... Commented Feb 3, 2019 at 19:00
  • the relation between 'niveau' and 'class': 'OneToMany': in a 'niveau' there are several 'classe'. Commented Feb 3, 2019 at 19:08
  • I donät understand what that comment means. But as said, 404 means that the url does not simply exist. Commented Feb 3, 2019 at 19:24
  • Please post full code as earlier said 404 is page not found/URL not found issue. Commented Feb 5, 2019 at 12:12

1 Answer 1

1

Probably you wrote the URL in Service incorrect or there is a problem in the backend. Don't forget that if you are using spring, define the parts with"/" using the RequestMapping.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.