Propriedades Computadas Básicas no Backbone
Namespace.models.Base = Backbone.Model.extend initialize: ()-> Backbone.Model::initialize @, arguments return if _.isUndefined(@computed) @_computed = {} for attr, dependencies of @computed @on “change:#{attr}”, ()=> @_computed[attr] = @[attr].call @ _(dependencies).each (dep)=> @on “change:#{dep}”, …
Continuar lendo