Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2012 20:49
Show Gist options
  • Save anonymous/4288534 to your computer and use it in GitHub Desktop.
Save anonymous/4288534 to your computer and use it in GitHub Desktop.
Scvrush.PostsController = Em.ArrayController.extend({
query: null,
queryChanged: function(value) {
var posts;
if (this.get("query") === "") {
posts = Scvrush.get("store").find(Scvrush.Post);
} else {
posts = Scvrush.get("store").find(Scvrush.Post, { query: this.get("query") });
}
this.set("content", posts);
console.log(this.get("query"));
}.observes("query")
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment