Created
October 17, 2014 03:40
-
-
Save mockra/1ff031800b1437cf99d1 to your computer and use it in GitHub Desktop.
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
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