OpenSource For You

Factory

-

Factory is a function that is used to create value. It creates value whenever a service or controller needs it. The factory function is used to calculate and return the value. Once it is created, the value is reusable for all services, controller­s, etc.

Here is an example that defines a factory on a module, and a controller which gets the factory-created value injected:

Newspapers in English

Newspapers from India