Skip to content

@dagda1 /binding.js.coffee
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
binding.js.coffee
LO.Controllers.ContactsController = Ember.ArrayProxy.extend
init: ->
@_super()
@set 'content', LO.get('backend_store').findAll LO.Models.Contact
@view = Ember.View.create
templateName: 'app/templates/contacts'
@view.appendTo 'body'
queryBinding: Ember.Binding.transform((value, binding) ->
value.map (item, index, self) ->
{name: item.firstName + ' ' + item.lastName}
).from 'LO.query_controller.content'
queryDidChange: ( ->
return unless @get('query').length > 0
query = @get 'query'
query.forEach (item) ->
LO.Models.Contact.createOrUpdate item
LO.get('radium_store').commit()
).observes('query')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.