@Dachu wrote:
Hi I must be doing some thing wrong here plaease assist I am getting this error
ERROR TypeError: Cannot read property 'http' of undefined
let postItem= new Object({ title:issue.title, issueDate:issue.issueDate, auditor:issue.auditor, issueSourceId:issue.issueSource.id, findings:[ { title:item.title, issueDetails:item.issue, imageUrl:item.imageUrl, signature:item.signature, foodSafetyCategoryId:item.foodSafetyCategory, areaId:item.area, natureId:item.nature, severityId:item.severity }, ] }); let headers = new Headers({'Content-Type': 'application/json'}); let options = new RequestOptions({ headers: headers }); this.http.post(this.postUrl,JSON.stringify(postItem),options). map(res => res.json()). subscribe(data=> console.log(data)); }) }and in constructor I have
public http: Http
Posts: 2
Participants: 2