I am using Angular 5 and my below function is posting the data to the server
doLogin(){
var link = 'https://www.sportsmanager.us/Ionic/ASPPages/IonicRMLogin.asp?Login=T&O=2';
var myData = JSON.stringify({txtEmailAddress: this.txtEmailAddress,txtPassword:this.txtPassword});
this.http.post(link, myData)
.subscribe(data => {
alert(data['code'])
}, error => {
alert("Oooops!");
});
}
and server return the json in following formart
{"code":"0","msg":"The email address entered is not assigned to any adult coaches. Please try a different email address or contact your administrator for assistance.", "page":"IonicRMHome.asp"}
when I try to get code value through data['code']. I get undefined error.