Created
September 24, 2012 20:32
-
-
Save lholmquist/3778193 to your computer and use it in GitHub Desktop.
Datamanger Memory Adapter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//When a field has multiple values, the filter method of the Memory Data Adapter won't work | |
//Here is some example data | |
userValve.save([ | |
{ | |
id: 12351, | |
fname: "Luke", | |
lname: "Public", | |
dept: [ "Accounting", "IT" ] | |
}, | |
{ | |
id: 12352, | |
fname: "Bob", | |
lname: "Private", | |
dept: [ "Finance", "IT" ] | |
}, | |
{ | |
id: 12353, | |
fname: "Joe Bob", | |
lname: "Public", | |
dept: [ "Accounting", "Other" ] | |
} | |
], true ); | |
var filtered = userValve.filter( { dept: "IT" } ); ==> will return an empty array | |
//The dept field is how the tags are stored in the todo app on the tasks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment