so I have been trying to learn about AngularJS factories to handle data outside of my controllers.. I am having a hard time with this one and could use some help, advice, or direction. so far this is what i have, but my $scope variable is not populating with data received from parse..thanks for any help...
app.factory('ParseData', function($http) {
var ParseFactory = {};
ParseFactory.getItems = function() {
$http({method : 'GET',url : 'https://api.parse.com/1/classes/DrinkMenu/', headers:
{ 'X-Parse-Application-Id':'xxxxxxxxxxxx',
'X-Parse-REST-API-Key':'xxxxxxxxxx'}})
.success(function(data, status) {
return data;
})
.error(function(data, status) {
alert("Error");
});
};
return ParseFactory;
});
app.controller('OrderFormController', function($scope, ParseData) {
$scope.items = ParseData.getItems();
});