-
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.
Skin done. dynamic Create/update views done.
- Loading branch information
Gabe Rogan
committed
Dec 1, 2016
1 parent
746ef7f
commit ea4a476
Showing
8 changed files
with
273 additions
and
159 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,7 +1,31 @@ | ||
app.controller('FoodCtrl', ['$scope', function ($scope) { | ||
app.controller('FoodCtrl', ['$scope', '$http', function ($scope, $http) { | ||
$http.get("assets/json/data.json") | ||
.then(function(response) { | ||
$scope.foods = response.data.data; | ||
}); | ||
|
||
$scope.page.title = 'Food'; | ||
$scope.page.id = 'food'; | ||
$scope.page.yourVar = "globalStuff"; | ||
|
||
$scope.var2 = "localStuff"; | ||
$scope.editMode = false; | ||
$scope.createMode = false; | ||
|
||
$scope.foodCRUD = {} | ||
|
||
$scope.edit = function (foodToEdit) { | ||
$scope.editMode = true; | ||
$scope.foodCRUD = foodToEdit; | ||
$scope.foodCRUD.rank_mode = "0"; //TODO: remove this when API implements it | ||
}; | ||
|
||
$scope.create = function () { | ||
$scope.createMode = true; | ||
$scope.foodCRUD = {} | ||
$scope.foodCRUD.rank_mode = "0"; | ||
}; | ||
|
||
$scope.cancel = function () { | ||
$scope.editMode = false; | ||
$scope.createMode = false; | ||
}; | ||
}]); |
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 |
---|---|---|
@@ -1,3 +1,21 @@ | ||
<script type="text/ng-template" id="/todos.html"> | ||
<ul></ul> | ||
</script> | ||
|
||
|
||
<!-- Food ranks --> | ||
<p>Grade</p> | ||
<div class="grade"> | ||
<!-- 0: auto, 1: green, 2: yellow, 3: red --> | ||
<input name="grade" type="radio" value="0" id="a" ng-model="foodCRUD.rank_id"> | ||
<label for="a">Auto</label> | ||
|
||
<input name="grade" type="radio" value="1" id="b" ng-model="foodCRUD.rank_id"> | ||
<label for="b">Green</label> | ||
|
||
<input name="grade" type="radio" value="2" id="c" ng-model="foodCRUD.rank_id"> | ||
<label for="c">Yellow</label> | ||
|
||
<input name="grade" type="radio" value="3" id="d" ng-model="foodCRUD.rank_id"> | ||
<label for="d">Red</label> | ||
</div> |
Oops, something went wrong.