I am currently working on developing a Contact Form, but I am facing an issue with generating a new ID for the POST function. Each time I try to set a new ID, I receive the following output:
{
_isScalar: false,
operator: Object {...},
source: Object {...}
}
Is there any solution to obtain a new ID that follows a sequence like 1, 2, 3, and so on?
public Add = (Name: string, Nachname: string, Geburtsdatum: string, Strasse: string, Hausnummer: string, Postleitzahl: string, Wohnort: string): Observable<boolean> => {
let id = this._http.get(this.actionUrl + 'getid', { headers: this.headers })
.map(res => res.json());
var toAdd = JSON.stringify({
Id: id,
Name: Name,
Nachname: Nachname,
Geburtsdatum: Geburtsdatum,
Strasse: Strasse,
Hausnummer: Hausnummer,
Postleitzahl: Postleitzahl,
Wohnort: Wohnort
});
console.error(toAdd);
var res = this._http.post(this.actionUrl, toAdd, { headers: this.headers })
.map(res => true)
.catch(this.handleError);
console.error(res);
return res;
}