Skip to content

Instantly share code, notes, and snippets.

@mockra mockra/new.js
Created Oct 17, 2014

Embed
What would you like to do?
import Ember from 'ember';
export default Ember.Controller.extend({
searchText: null,
searchResults: [],
updateResults: function() {
var self = this;
var searchText = self.get('searchText');
if (!searchText) { return; }
var encoded = encodeURIComponent(searchText);
Ember.$.get("/your/autocomplete/path?term=" + encoded, function(json) {
self.set('searchResults', json);
});
}.property('searchText')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.