|
@@ -1,53 +1,4 @@
|
|
|
-angular.module('basicFoodEditor', ['ndbDatabase', 'ngResource'])
|
|
|
|
|
- .factory('BasicFood', ['$resource', '$q', function($resource, $q) {
|
|
|
|
|
- return $resource('food/basic/:id', {id: "@id"}, {
|
|
|
|
|
- 'get': {
|
|
|
|
|
- url: "food/:id",
|
|
|
|
|
- method: 'GET'
|
|
|
|
|
- },
|
|
|
|
|
- 'query': {
|
|
|
|
|
- url: "food/basic/query/:query",
|
|
|
|
|
- method: 'GET',
|
|
|
|
|
- isArray: true
|
|
|
|
|
- },
|
|
|
|
|
- 'save': {method: 'PUT'},
|
|
|
|
|
- 'update': {method: 'POST'},
|
|
|
|
|
- 'delete': {
|
|
|
|
|
- url: "food/:id",
|
|
|
|
|
- method: 'DELETE'
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }])
|
|
|
|
|
- .factory('Recipe', ['$resource', '$q', function($resource, $q) {
|
|
|
|
|
- return $resource('food/recipe/:id', {id: "@id"}, {
|
|
|
|
|
- 'get': {
|
|
|
|
|
- url: "food/:id",
|
|
|
|
|
- method: 'GET'
|
|
|
|
|
- },
|
|
|
|
|
- 'query': {
|
|
|
|
|
- url: "food/recipe/query/:query",
|
|
|
|
|
- method: 'GET',
|
|
|
|
|
- isArray: true
|
|
|
|
|
- },
|
|
|
|
|
- 'save': {method: 'PUT'},
|
|
|
|
|
- 'update': {method: 'POST'},
|
|
|
|
|
- 'delete': {
|
|
|
|
|
- url: "food/:id",
|
|
|
|
|
- method: 'DELETE'
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }])
|
|
|
|
|
- .factory('Food', ['$resource', '$q', function($resource, $q) {
|
|
|
|
|
- return $resource('food/:id', {id: "@id"}, {
|
|
|
|
|
- 'get': {method: 'GET'},
|
|
|
|
|
- 'query': {
|
|
|
|
|
- url: "food/query/:query/",
|
|
|
|
|
- method: 'GET',
|
|
|
|
|
- isArray: true
|
|
|
|
|
- },
|
|
|
|
|
- 'delete': {method: 'DELETE'}
|
|
|
|
|
- });
|
|
|
|
|
- }])
|
|
|
|
|
|
|
+angular.module('basicFoodEditor', ['ndbDatabase', 'ngResource', 'Food'])
|
|
|
// TODO: Only ever used with editBasicFood template. See if can auto link.
|
|
// TODO: Only ever used with editBasicFood template. See if can auto link.
|
|
|
.controller('BasicFoodEditorController',
|
|
.controller('BasicFoodEditorController',
|
|
|
['$scope', '$uibModalInstance', 'NDBList', 'BasicFood', 'foodData', 'ndbKey',
|
|
['$scope', '$uibModalInstance', 'NDBList', 'BasicFood', 'foodData', 'ndbKey',
|