I am playing around with Angular and came about an issue. The toggle I have set up on the Edit button works until I either click on the Save or Cancel button. Then it doesn't work anymore.
Here is my Plunker: http://plnkr.co/edit/Vy2WeUkk7jvIjp1z8Sfi
<section ng-controller="ContactController">
<ul class="list-group">
<li class="list-group-item" ng-repeat="contact in contacts">
<h3>
{{ contact.id }}
<em class="pull-right">{{contact.fname }} {{ contact.lname }} <button ng-click="editing = !editing">Edit</button></em>
<form ng-show="editing" ng-submit="editing = false" ng-controller="FormController">
<input type="hidden" ng-model="contact.id">
<label>First Name:</label>
<input type="text" ng-model="contact.fname" placeholder="first name" ng-required/>
<label>Last Name:</label>
<input type="text" ng-model="contact.lname" placeholder="last name" ng-required/>
<br/>
<button class="btn" ng-click="Save();" type="submit">Save</button>
<button class="btn" ng-click="editing = false">Cancel</button>
</form>
</h3>
</li>
</ul>
</section>
Any help would be appreciated.