Created
November 6, 2014 19:03
-
-
Save manderly/5a9965243dfde4eefc23 to your computer and use it in GitHub Desktop.
ChickenBreastMeals: Editable ingredients list created with ng-repeat
This file contains hidden or 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
<h2>Ingredients</h2> | |
<ol class="ingredients-list"> | |
<!-- loop through and display existing ingredients --> | |
<li data-ng-repeat="ingredient in formMeal.ingredients track by $index"> | |
<textarea name="ingredientLines" | |
type="text" | |
data-ng-model="formMeal.ingredients[$index].name" | |
placeholder="Add ingredient" | |
data-ng-change="changeIngredient($index)" | |
></textarea> | |
<!-- trash can button --> | |
<a href="" data-ng-show="ingredient" | |
data-ng-click="formMeal.ingredients.splice($index,1)"> | |
<img src="/assets/delete.png"/></a> | |
</li> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment