I don't understand when to use Angular over jquery for ajax requests.
For example, why should I use:
function ItemListCtrl ($scope, $http) {
$http.get('example.com/items').success(function (data) {
$scope.items = data;
}
}
Instead of
function ItemListCtrl ($scope) {
$.ajax({type: "GET", url: 'example.com/items',
success: function (result) {
$scope.items = data;
}
});
}
??