adds angular controller and factory