Guest User

Untitled

a guest
Oct 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. addIncidents(newIncidents: Incidents): Observable<Incidents> {
  2. return this.http.post<Incidents>('api/v1/events', newIncidents, {
  3. headers: new HttpHeaders({
  4. 'Content-Type' : 'application/json'
  5. })
  6. });
  7.  
  8. saveIncidents(formValues: any): void {
  9. const newIncidents: Incidents = <Incidents>formValues;
  10. console.log(newIncidents);
  11. this.dataStorageService.addIncidents(newIncidents)
  12. .subscribe(
  13. (data: Incidents) => console.log(data),
  14. (err: any) => console.log(err)
  15. );
  16. }
  17.  
  18. <button type="button" class="btn btn-primary" (click)="saveIncidents()">Submit</button>
Add Comment
Please, Sign In to add comment