Created
October 23, 2017 18:58
-
-
Save ragowthaman/9fe4cefd785f23c9131a79c25945a2d4 to your computer and use it in GitHub Desktop.
Angular 4 Get Data from server via webserivce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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;` | |
}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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