Kacey Ezerioha Kacey Ezerioha - 2 months ago 13
AngularJS Question

Boolean variable .toString() Function Displays [Object Object]

I have a C# bool method that is called and executed on the client through AngularJS. The method works without any error as I have confirmed but the string result (

result.toString()
) of the execution (true or false) displays
[Object Object]
instead. Below is the script function;

vm.isActiveCustomer = function(sp) {
abp.ui.setBusy();
var result = sessionService.isActiveCustomer({
id: sp.id
}).success(function() {
abp.notify.info(result.toString());
}).finally(function() {
abp.ui.clearBusy();
});
}


It looks simple but I can't get it to display what I want. Please Help.

Answer

You are missing an argument to the success callback. result is a likely a promise and handling an async request. You'll have to keep the flow and keep it async.

Comments