Service and Factory both just a simple function. Service acts as a constructor function but Factory is really just a function that gets called, which is why we have to return an object explicitly. We can create & return anything that's why Factory is much more powerful and flexible.
reference: https://toddmotto.com/factory-versus-service
app.service('MyService', function () {
this.sayHello = function () {
console.log('hello');
};