When working with AngularJs and calling a service method:
app.service('nameService', function() {
this.Service = function (){console.log('hello')}
}
You can then use this service (object) like so: nameService.Service() My question is, how can I write a function that takes two arguments - a name and a function?
function service(name, func) {
// How does Angular declare an object with the value of the first argument?
}
I am asking how to write a function like service(name, fn){}.