basicFoodEditor.js 818 B

1234567891011121314151617181920212223242526
  1. /**
  2. * A pane that displays/edits basic food objects
  3. */
  4. (function() {
  5. (function() {
  6. try {return angular.module('ieat.ui.editors')}
  7. catch {return angular.module('ieat.ui.editors', ['ndbDatabase', 'ngResource', 'Food'])}}
  8. )().component('basicFoodEditor', {
  9. templateUrl: 'static/templates/basicFoodEditor.html',
  10. bindings: {
  11. ndbKey: '@',
  12. food: '<'
  13. },
  14. controller: [
  15. '$scope', 'NDBList', 'BasicFood',
  16. function($scope, NDBList, BasicFood) {
  17. var self = this;
  18. this.$onInit = function() {
  19. $scope.catagories = NDBList.get({
  20. key: self.ndbKey,
  21. type: "g"
  22. });
  23. };
  24. }]
  25. });
  26. })();