Skip to content

Instantly share code, notes, and snippets.

@qrg
Last active August 29, 2015 14:00
Show Gist options
  • Save qrg/11319317 to your computer and use it in GitHub Desktop.
Save qrg/11319317 to your computer and use it in GitHub Desktop.
# mixin ---------------------------------------------
mixins = require 'mixins'
module.exports = mixins.foo =
bindings:
'.js-mixin-binding-target': 'someModelAttr'
mixinMethod: ->
# do something
# view ---------------------------------------------
View = require 'views/base/view'
mixins = require 'mixins'
module.exports = class BarView extends View
_(@prototype).extend mixins.foo
_(@prototype.bindings).extend
'.js-view-binding-target': 'otherModelAttr'
viewMethod: ->
# do something
@qrg
Copy link
Author

qrg commented Apr 26, 2014

backbone-deep-model を将来的に使わなくなって uninstall したときに動かなくなるのも困るので、結局 jquery の extend を利用することにした

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