Skip to content

Instantly share code, notes, and snippets.

@ragowthaman
Created October 23, 2017 18:58
Show Gist options
  • Save ragowthaman/9fe4cefd785f23c9131a79c25945a2d4 to your computer and use it in GitHub Desktop.
Save ragowthaman/9fe4cefd785f23c9131a79c25945a2d4 to your computer and use it in GitHub Desktop.
Angular 4 Get Data from server via webserivce
getConsultantDataFromServer(){
this.DataWebService.getConsultantsFromServer().subscribe(data => {
this.data = data;
console.log(data);
this.dataSource = new MyDataSource(this.data, this.paginator, this.sort, this.firstname, this.lastname);
this.data_length = data.length;`
})
}
getConsultantsFromServer() {
let data = {"business_shortname": "Marico"};
// let data = {"business_shortname": "VUFPO"};
return this.http.put("http://localhost:8000/instance/webservice/serve/consultants/for/business/", data, {headers: this.headers})
.map(res => res.json());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment