Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

ERROR TypeError: Cannot read property 'http' of undefined

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>