Skip to content

Instantly share code, notes, and snippets.

@omarqureshi
Last active August 29, 2015 14:17
Show Gist options
  • Save omarqureshi/b6dbe126daa5de033ec1 to your computer and use it in GitHub Desktop.
Save omarqureshi/b6dbe126daa5de033ec1 to your computer and use it in GitHub Desktop.
$scope.archiveGoal = function(goal) {
goal.removed_at = new Date();
goal.editable = false;
Goal.update({goal: goal, id: goal.id});
};
<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>
<div class="form-group no-margin-bottom" ng-if="goal.id && !goal.removed_at">
<input type="submit" value="Save" class="btn btn--save"> &nbsp; <button class="btn btn--archive" ng-click="archiveGoal($parent.goal)">Archive</button> &nbsp; <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