@thilinanara wrote:
this is my class
.
export class publicip {
publicip: string;
constructor(private http:Http) {
//this.navCtrl.push(MainPage);
}public getip(){
let headers = new Headers({‘Content-Type’:‘application/x-www-form-urlencoded’,‘Accept’:‘application/json’});
let options = new RequestOptions({headers:headers});
let credentials = “username=”+’’+"&password="+’’;
// index.php/rest_api_mobile/index_post
this.http.post(‘http://localhost/mechmarcl_website/index.php/Admin/getpublicip’, credentials, options).
map(res => res.json()).subscribe(
data => {if(data['status']==true && data['data']['login']==true){ //Store user Info this.publicip=data['data']; console.log("done"); console.log(this.publicip); }else{ } }, err => { console.log("ERROR!: ", err); } );
}
}what should i pass as the parameter when i call to this getip method from outside.
this.public = new publicip(’-----).getip();
Posts: 1
Participants: 1