2

Is a factory a singleton? If it is, what is the difference between a factory and a service? When should each be used?

Eddie Monge Jr
  • 12,676
  • 2
  • 19
  • 24
user3475306
  • 127
  • 8

1 Answers1

2

Yes mate, factories and a services are both Singletons.

Generally it's preference which to use, but generally the community more leans toward factories because they are easier to invoke.

this question is a duplicate of this:

service-vs-provider-vs-factory

Also this is a really good styling with a lot of helpful information:

John Papa styling guide

I hope that helps

Community
  • 1
  • 1
Darren Lilley
  • 404
  • 5
  • 9