MY code is like this
$scope.shipment = new function () {
this.type = "";
this.carrier = "";
this.sInstruction = "";
this.getInfo = function () {
if (this.type == 'collect-parcel') {
$http.post('../services/getratesws.aspx', { 'Content-type': 'application/json' }).
success(function(data) {
this.sInstruction = data;
});
}
};
}
As you can see I am trying to set value for "sInstruction" inside my function. but the value is not taken and "sInstruction" remains empty.Can any one point out what I am doing wrong?