Skip to content

Commit

Permalink
Create button to delete idea
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwebster committed Mar 27, 2015
1 parent 04205fc commit 67339d9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions client/app/ideaDetail/ideaDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<div class="jumbotron jumbo-top">
<h1 class="animated fadeInUp">{{clctrl.idea.title}}</h1>
<h4 class="animated fadeInUp">Created {{ clctrl.idea.created_at | moment }} by {{ clctrl.idea.created_by }}</h4>
<!-- Delete this idea (TODO: only let admin do this) -->
<button ng-if="true" type="submit" class="btn btn-default idea-submit-button ng-cloak animated fadeInUp" ng-click="clctrl.deleteIdea()">Delete this idea</button>
<!--- TODO: add a check to make sure you want to delete this idea -->
</div>

<!-- User Feedback Message Area -->
Expand Down
18 changes: 16 additions & 2 deletions client/app/ideaDetail/ideaDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,23 @@ angular.module( 'glint.ideaDetail', [] )
} )
.catch( function( error ) {
console.error( 'editDescription error', error );
} );
} );
};

self.deleteIdea = function() {
console.log('deleting this dumb idea');

// TODO: add a check to make sure you want to delete this idea


// // DELETE idea, redirect to homepage.
// IdeaDetail.deleteIdea( self._id )
// .then( function( response ) {
// // redirect to homepage
// $location.path('/');
// } )
// .catch( function( error ) {
// console.error( 'deleteIdea error', error );
// } );
};

// Submit a new idea.
Expand Down

0 comments on commit 67339d9

Please sign in to comment.