I call a function
getData('serviceName', 'functionName')
That function looks like
function getData(service, functionName){
service.functionName(request, $root.thing).then()
}
But I always get service.function is not a function, how do I call them properly?
functionNamefrom your service?? Is afactoryorservice?.then? Is a promise? Uhm are you sure that you return that function from your service? You are in controller when you callgetDataso? If you can provide a plunker we can help you bettermyServiceis a string. It is not a real service. It doesn't havefindDatamethod. Please, provide full code and not the excerpts, so it would be possible to note what exactly should be fixed in your code.