Last active
August 29, 2015 14:17
-
-
Save omarqureshi/b6dbe126daa5de033ec1 to your computer and use it in GitHub Desktop.
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
$scope.archiveGoal = function(goal) { | |
goal.removed_at = new Date(); | |
goal.editable = false; | |
Goal.update({goal: goal, id: goal.id}); | |
}; |
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
<ul class="[ list-unstyled ]" ng-if="(goals | filter: {removed_at: '!'}).length > 0"> | |
<li class="goal" ng-repeat="goal in goals | filter: {removed_at: '!'}"> | |
{{ goal }} | |
<div ng-include="'/views/goals/show.html'"></div> | |
</li> | |
</ul> |
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
<div class="form-group no-margin-bottom" ng-if="goal.id && !goal.removed_at"> | |
<input type="submit" value="Save" class="btn btn--save"> <button class="btn btn--archive" ng-click="archiveGoal($parent.goal)">Archive</button> <a href="#" class="btn btn--cancel" ng-click="goal.editable = false">Cancel</a> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment