Factory method is one of the services in AngularJS.
AngularJS factory method is generating a singleton object or injectable function. The object or function is passed as a parameter to any other factory function which specifies a dependency on this service.
Syntax for Factory service in AngularJS:
Sample Coding for Factory service in AngularJS:
Code Explanation for Factory service in AngularJS: