Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between Factory, Service and Provider?

Answer Posted / chaitanya

Factory - A factory is a simple function which allows you to add some logic before creating the object. It returns the created object.

Service - A service is a constructor function which creates the object using new keyword. You can add properties and functions to a service object by using this keyword. Unlike factory, it doesn’t return anything.

Provider - A provider is used to create a configurable service object. It returns value by using $get() function.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of ngfortrackby directive?

814


What are observables in angular 2?

787


List the types of data binding supported by angular 5?

778


What is the scope in angularjs?

857


What is app_base_href in angular 4/5?

814


Explain what is di (dependency injection) and how an object or function can get a hold of its dependencies?

799


What are @injectable providers?

754


What is pathmatch in angular?

830


What is eventemitter in angular?

800


What is routing concepts in angular?

823


Difference between angular 2, 4, 5, 6, &7?

797


What are directives? How to create and use custom directive in angularjs.

814


Is primefaces free?

779


Explain routing in angularjs?

747


How will you explain manual bootstrap process in angularjs?

745