Last active
August 29, 2015 14:00
-
-
Save designeng/11372318 to your computer and use it in GitHub Desktop.
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
define -> | |
class AutoCompleteController | |
# @injected | |
input: undefined | |
# @injected | |
listCollection: undefined | |
curId: 0 | |
onTextInputKeyUp: (e) -> | |
# model in collection has only one significant field "port", "id" is used for domestic collection consumption - | |
# but it's a problem: we need to set "id" explicitly... or not? | |
@listCollection.add {id: @curId, port: e.target.value} | |
@curId++ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The question is: how to avoid explicit "id" in collection item?