Skip to content

Instantly share code, notes, and snippets.

@hulufei
Created June 28, 2012 10:59
Show Gist options
  • Save hulufei/3010672 to your computer and use it in GitHub Desktop.
Save hulufei/3010672 to your computer and use it in GitHub Desktop.
Spine Ajax update model handle
class User extends Spine.Model
@configure 'User', 'name'
@extend Spine.Model.Ajax
@url: '/save'
user = new User(name: 'test')
# 设定/save直接返回 {flag: 0}
user.save()
User.bind 'update', (item) ->
# Ajax请求完成之后update,item里面没有flag属性
console.log(item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment