Creating your own services in AngularJS can be confusing. What are the differences between an AngularJS module's Service, Provider and Factory functions? This lesson shows how Angular's factory function is just the JavaScript module design pattern.
Was hoping to learn if there are any particular scenarios to choose Service over Factory or vice versa.
I still have a few more video to record and add to the playlist that go over the tradeoffs but for the most part it's more of a coding style thing than any actual performance or practical difference. For example, Service services lend themselves to using ES6/ES2015 classes or an object oriented style while Factories let you use a module or revealing module style of coding. That said if you want inheritance you would lean towards the service recipe.
Thanks! Looking forward to seeng new episodes.
If we were to add another controller and inject the droid factory, angular would reuse the same instance and would not create a new one?
Yes, you are correct it would be a singleton.