Skip to content

Instantly share code, notes, and snippets.

@lholmquist
Created September 25, 2012 18:45
Show Gist options
  • Save lholmquist/3783658 to your computer and use it in GitHub Desktop.
Save lholmquist/3783658 to your computer and use it in GitHub Desktop.
Datamanger Memory Adapter - Filter Logic
//should this return 1 or 2 values? and yes this is out of order, not suppose to be real code
var filtered = tasksValve.filter( { tags: 111 } );
//the datamanager for this example
var tasksValve = aerogear.dataManager( "tasks" ).valves.tasks;
tasksValve.save([
{
id: 12345,
date: "2012-07-30",
title: "Task 1-1",
description: "Task 1-1 description text",
project: 11,
tags: [ 111 ]
},
{
id: 67890,
date: "2012-07-30",
title: "Task 2-1",
description: "Task 2-1 description text",
project: 22,
tags: [ 111, 222 ]
},
{
id: 54321,
date: "2012-07-30",
title: "Task 3-1",
description: "Task 3-1 description text",
project: 33,
tags: [ 222 ]
}
], true );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment