How to make Ajax calls from AngularJs

$http service can be called to make Ajax calls from Angular 


var app = angular.module('myApp', []).config(/* config stuff */ );
app.PersonFactory = angular.factory('PersonResource', function($http) {
  /* your code here */
  /* when you want to make Ajax calls, use $http */
     .success(function (response) {...})
  /* keep going */

Additionally, if your Persons resource is RESTful, you can just use $resource, ie.

var app = angular.module('myApp', []).... /* setup app */
app.personsFactory = angular.factory('personsFactory', function($resource) {
  var persons = $resource('/api/persons/:id', {id: '@id'});
  return persons;

That way angular will know that on your /api/persons url it can GET persons, it can POST an new person, it can PUT an update for a person and DELETE a person.