0

I read a lot of angularjs tutorials.

But I do not underestand config() and factory()..

config(): for set values and method must runs when page loads.

factory(): a place for methods!

Am I right?

salome
  • 53
  • 4
  • 8
  • 3
    Possible duplicate of [AngularJS: Service vs provider vs factory](http://stackoverflow.com/questions/15666048/angularjs-service-vs-provider-vs-factory) – miensol Jan 12 '16 at 17:09
  • I use config to register and configure global actions, like a default error handler for REST. And, with factory, you can to create stateless functions for general usage, like "saveClientInformation(client)". With services, you can to create statefull functions, like getCount() and setCount(), for several controllers, as example. – Joao Polo Jan 12 '16 at 17:11
  • @ Joaozito Polo thanks. very helpfull – salome Jan 12 '16 at 17:18
  • Good place to start would be the documentation – charlietfl Jan 12 '16 at 17:37

0 Answers0