Skip to content

Instantly share code, notes, and snippets.

@designeng
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save designeng/11372318 to your computer and use it in GitHub Desktop.
Save designeng/11372318 to your computer and use it in GitHub Desktop.
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++
@designeng
Copy link
Author

The question is: how to avoid explicit "id" in collection item?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment