Angularjs Examples

AJS Examples


AngularJS Factory

In AngularJS services can be created using service, factory and provider. Service object contains few useful functions that you can call from Controllers, Directive and Filters etc.

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

Syntax

AngularJS Factory Example

See Live Example