Passing data from Javascript object to controller

Hello All, I am currently working on Android app using ionic framework.

I created a java script object where I exposed different methods to perform some operations. I am calling these object methods from controller. I want to pass response back to controller. How to do that?

windows.dao = {
resetdatabase = function(){
   log("database reset");
   callback();
}
 }

in my controller, I had a method called log() which updates UI. But when I call log() like above it was not working. How to pass data from object to controller?

Thanks.