What is the difference between a service() and a factory()?
Answer»
factory()
service()
The factory function allows developers to add certain logic before the creation of an object.
This one is a constructor function which helps creating the object with a new keyword. Developers can add functions and properties to a service object by using the keyword.