Service & Factory

Purpose:
  1. Serves as a Model for Data
  2. Useful functions for Data Manipulation
Helps in:
  • Seperation of concern
  • Function Re-use in controllers, filters, directives etc.

First Controller

Square: {{f.numberSquare(f.number)}}
Cube: {{f.numberCube(f.number)}}