I have defined an angular factory and controller with the following code:
angular.module('myApp', ['ui.router', 'ngResource'])
.factory('Widget', ['$http', function WidgetFactory($http) {
return {
all: function() {
return $http({method: "GET", url: "/widgets"});
}
};
}])
.controller('StoreCtrl', ['$scope', 'Widget', function($scope, Widget) {
$scope.widgets = Widget.all();
}]);
Within my front-end HTML, I am using the following structure:
<div ng-controller="StoreCtrl">
<li ng-repeat="widget in widgets">
{{ widget.price }}
{{ widget.name }}
</li>
</div>
Despite this setup, nothing is showing up for {{ widget.price }}
or any other fields.
What could be causing this issue?