I am confused on why my services aren't working. Here is where I am at https://jsfiddle.net/regy3cps/ There is some commented code on there that had an app module of ngResource to make it work along with a js file but maybe someone can tell me why that doesn't work either if they understand ngResource.
angular.module('priceCompareApp', [])
//.factory('dish', function($resource, $http){
// var baseUrl = "http://www.decentrix.net/services/";
// var programming = "programming/";
//
// //return $resource(baseUrl + 'packages', {}, {
// // packages: {method: 'GET', isArray:true},
// // smartpack: {url: baseUrl + programming + 'SmartPack', method: 'GET', isArray:true},
// // at120: {url: baseUrl + programming + 'at120', method: 'GET', isArray:true},
// // at120p: {url: baseUrl + programming + 'at120p', method: 'GET', isArray:true},
// // at200: {url: baseUrl + programming + 'at200', method: 'GET', isArray:true},
// // at250: {url: baseUrl + programming + 'at250', method: 'GET', isArray:true}
// //})
//})
//
//.controller('compareApp', function ($scope, dish){
// $scope.packages = dish.packages;
// $scope.smartpack = dish.smartpack();
// $scope.at120 = dish.at120();
// $scope.at120p = dish.at120p();
// $scope.at200 = dish.at200();
// $scope.at250 = dish.at250();
//});
.factory('dish', ['$http', function($http) {
return $http.get('http://www.decentrix.net/services/packages')
.success(function(data) {
return data;
})
.error(function(err) {
return err;
});
}])
.controller('MainController', ['$scope', 'dish', function($scope, dish) {
dish.success(function(data) {
$scope.packages = data;
});
}]);
EDIT There is something off about my code somewhere. I made my $scope.packages = manual data and it's not working.