in Angular by
What is the difference between a service() and a factory()?

1 Answer

0 votes

A service() in Angular is a function that is used for the business layer of the application. It operates as a constructor function and is invoked once at the runtime using the ‘new’ keyword. Whereas factory() is a function which works similar to the service() but is much more powerful and flexible. factory() are design patterns which help in creating Objects.

Related questions

0 votes
asked Aug 22, 2019 in Selenium by john ganales
+1 vote
asked Jan 15, 2020 in Angular by rahuljain1