I have a Collection in ChaplinJS that has the following initialization code:
Chaplin = require 'chaplin'
Collection = require 'models/base/collection'
Domain = require 'models/domain'
mediator = require 'mediator'
module.exports = class Domains extends Collection
model: Domain
# Initialize the SyncMachine
_(@prototype).extend Chaplin.SyncMachine
initialize: ->
super
@.totalHits = 0
How can I reference totalHits
in the template of its view? I am using handlebars templates, and writing {{totalHits}}
returns nothing.
Incidentally, shouldn't I be able to rewrite the above code with:
module.exports = class Domains extends Collection
model: Domain
totalHits: 0