aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-01-24 23:17:55 -0500
committerTeddy Wing2015-01-24 23:17:55 -0500
commit397bdfd9ee28b62afb88d9e2e6872d679a9e3b19 (patch)
treeb1ef6dbc67984a7334f0bc1e56881865e1fe6508
parent08b6f4f8ee8823512ab7d5d4d13998f7d6cbfe46 (diff)
downloadNotes-angular-demo-397bdfd9ee28b62afb88d9e2e6872d679a9e3b19.tar.bz2
services/notes.js: Simplify save function
Leverage Angular `$resource`s `$save` method to simplify this function.
-rw-r--r--app/assets/javascripts/services/notes.js7
1 files changed, 1 insertions, 6 deletions
diff --git a/app/assets/javascripts/services/notes.js b/app/assets/javascripts/services/notes.js
index bfa0b03..389f25d 100644
--- a/app/assets/javascripts/services/notes.js
+++ b/app/assets/javascripts/services/notes.js
@@ -24,12 +24,7 @@ angular
},
save: function() {
- console.log(this.current_note.body);
- Note.save({
- id: this.current_note.id,
- title: this.current_note.title,
- body: this.current_note.body
- });
+ this.current_note.$save();
},
create: function () {