AngularJS provides
factory() method to create factory object that can be reused across application.A factory object can be
injected to any module in AngularJS application.In this
Demo, "
We will create factory object called with some method and inject this object to a controller".Below code uses factory() method to create
StringUtil object.It has 2 methods
getReverseString() for reversing the input string and
getCharacterCount() for return the length of the input string.<!DOCTYPE html>...
Published on November 11, 2014 09:09