-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gabe Rogan
committed
Feb 6, 2017
1 parent
874e6c7
commit 5fa1614
Showing
8 changed files
with
117 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
var app = angular.module('app', ['ngRoute']); | ||
var app = angular.module('app', ['ngRoute', 'ngResource']); | ||
|
||
// Root controllers in /root/ folder | ||
// Page controllers in /pages/[your-page] folder | ||
|
||
// Factories | ||
app.factory('Foods', function($resource) { | ||
return $resource('assets/json/foods.json'); | ||
}); | ||
|
||
// Just does a PUT request when u call Food.update | ||
app.factory('Food', function ($resource) { | ||
// {food: '@id'} means replace :food with $scope.foodCRUD.id | ||
var data = $resource('http://foodbank.develop.digitalmediauconn.org/api/food/:food', {food: '@id'}, { | ||
update:{ method:'PUT' } | ||
}); | ||
return data; | ||
}); | ||
|
||
app.factory('Categories', function($resource) { | ||
return $resource('assets/json/categories.json'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- REST Template --> | ||
<div ng-repeat="(key, value) in foods"> | ||
{{key}} : {{value}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters