Hi Rekha,
Do you still have this issue?
Thing is, your submit function is neglecting the async nature of the
http call.
Submit() {
// first problem:
let templateId;
this.route.params.subscribe( (param: any) => { templateId =
+param['templateid']; });
// the above code runs async, so at this point in time templateId ===
undefined
if (templateId === 0) {
// So, this code will Never be run!
this.jobservice.addJob(this.job).subscribe(error => this.errorMessage =
<any>error);
}
// this will run directly, without awaiting the result from anything about
thispoint, giving a kind of unprediceted results
this.router.navigate(['/template']);
}
But looking at your result, I would say that it is the result of posting
the form without any JS running. seems like a plain HTML form submit result.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.