[Pkg-javascript-commits] [backbone] 119/173: fix modelId example
Jonas Smedegaard
dr at jones.dk
Wed Aug 31 07:44:10 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository backbone.
commit 4caa6e6835fdb558b6575bdba882f47b050c5516
Author: Craig Martin <cmartin at onshift.com>
Date: Sat Jan 23 22:47:20 2016 -0500
fix modelId example
---
index.html | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/index.html b/index.html
index e49fe07..a5b3c96 100644
--- a/index.html
+++ b/index.html
@@ -1796,10 +1796,9 @@ var Library = Backbone.Collection.extend({
var Library = Backbone.Collection.extend({
modelId: function(attrs) {
if (attrs.type === 'dvd') {
- return 'dvd' + attrs.dvd_id;
- } else {
- return 'vhs' + attrs.vhs_id;
+ return 'dvd' + attrs.id;
}
+ return 'vhs' + attrs.id;
}
});
@@ -1808,7 +1807,9 @@ var library = new Library([
{type: 'vhs', id: 1}
]);
-alert('dvd: ' + library.get('dvd1').id + ', vhs: ' + library.get('vhs1').id);
+var dvdId = library.get('dvd1').id;
+var vhsId = library.get('vhs1').id;
+alert('dvd: ' + dvdId + ', vhs: ' + vhsId);
</pre>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list