Some notes on angular services vs factories vs providers

Was deciding between the 3 today, did a fair bit of research and asking around. Conclusion is some rough heuristics for the choice:

if (need to be configured): use providers; else if (need to generate instance of object): use factory else: use service

Of course, this is far from definitive, but a good starting point for decision-making.

Seah Ying Cong

Old soul in an older body.

Subscribe to Ying Cong

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!