What is the difference between a service and a factory in AngularJS?
A. A factory returns an object or a function, while a service returns a value or an object
B. A service is a function that can be injected into controllers or other services, while a factory is a method that creates an object or a function
C. A service is a way to share code across an application, while a factory is a way to provide data to controllers
D. There is no difference between a service and a factory in AngularJS
Answer:B
What is the difference between a service and a factory in AngularJS?
A. A factory returns an object or a function, while a service returns a value or an object B. A service is a function that can be injected into controllers or other services, while a factory is a method that creates an object or a function C. A service is a way to share code across an application, while a factory is a way to provide data to controllers D. There is no difference between a service and a factory in AngularJS