Skip to content

Instantly share code, notes, and snippets.

@kid
Last active April 18, 2016 14:30
Show Gist options
  • Save kid/41c59c8d55a3cf395e48d712545443cd to your computer and use it in GitHub Desktop.
Save kid/41c59c8d55a3cf395e48d712545443cd to your computer and use it in GitHub Desktop.
search (term) ->
if Ember.isBlank(term)
[]
else
@get('store')
.query('theme', { filter: { 'pref-label': term } })
.then (result) ->
result.push('Create object: blabla')
result
search(function(term) {
if (Ember.isBlank(term)) {
return [];
} else {
return this.get('store').query('theme', {
filter: {
'pref-label': term
}
}).then(function(result) {
result.push('Create object: blabla');
return result;
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment