A
A
Anton2015-09-23 21:29:09
Angular
Anton, 2015-09-23 21:29:09

What are recipes and providers in angular.js?

In the angular.js basics literature, I found this line: "Once a module is declared, it can immediately be used to register recipes for creating objects. Recall that in AngularJS terminology, recipes are called providers."
Questions:
1) what are the recipes for creating objects?
2) Maybe before I get into Angular, I should read something else that explains what recipes, providers, factories, etc. are? If so, what would you recommend to smoke?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-09-23
@tunikov

what are the recipes for creating objects?

I suspect that we are talking about factories. Burn this book (or whatever you read there).
Wikipedia and learn JS.
Regarding all sorts of factories, etc. ... I somehow made an example - the whole difference is here. Well, yes, there are still two phases - configuration and launch, let's say constants are available everywhere, providers are only at the configuration stage, factories are not available at all - only what they generate is available ....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question