Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Commit

Permalink
Examples can now be looked up by name
Browse files Browse the repository at this point in the history
  • Loading branch information
prasmussen committed Apr 6, 2013
1 parent 2d2f05c commit 5d88964
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/scripts/services/examples.js
Expand Up @@ -6,6 +6,11 @@ angular.module('glotApp').factory('Examples', function(Couch, Response) {
byLanguage: function(id) {
var req = Couch.db("api").view("examples", "by_language", {key: id});
return Response.toArray(req);
},

byName: function(language, name) {
var req = Couch.db("api").view("examples", "by_name", {key: [language, name]});
return Response.toObject(req);
}
};
});

0 comments on commit 5d88964

Please sign in to comment.