Last active
October 2, 2016 17:06
-
-
Save initram/9ce5aa66ba8908046044ac5dd7b68961 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains 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'; | |
import myTemplate from '../templates/suggestion-template' | |
export default Ember.Controller.extend({ | |
suggestionTemplate: myTemplate, | |
suggestSource: function(query, syncResults, asyncResults) { | |
if(query == 'test') | |
syncResults([{id: 2, text: "testing is fun!"}]); | |
else | |
syncResults([{id: 1, text: "test"}]); | |
}, | |
getDisplayString : function(suggestion) { | |
if(typeof suggestion === "string") | |
return suggestion; | |
return suggestion.text; | |
}, | |
updateValue: function(newValue){ | |
this.set('searchInput', getDisplayString(newValue)) | |
} | |
}); |
This file contains 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
{ | |
"version": "0.10.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.6.0", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": { | |
"ember-aupac-typeahead": "2.0.7" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment