You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to debug the following situation (where I'm probably messing something up) would be easier with more verbose error handling in the console. In the scenario below, I know spellbinder's data-event is working as expected:
Instantiate new model
foo = new Backbone.Model(name: 'test name')
Render view for table, then render row view into table
class App.FooTableView extends Backbone.View
template: @template('table')
initialize: -> Spellbinder.initialize(@)
render: ->
new App.FooRowView(el: '#foo-row').render()
data-bind="name" renders nothing, no error to help debug
<td><span data-bind="name"></span></td>
It's clear that spellbinder successfully identifies the data-bind in the template, but it's tough to tell why it's unable to find foo.name, especially since model.get('name') works.
The text was updated successfully, but these errors were encountered:
btw - figured out the issue - I was declaring the model attribute in the constructor (since I was just working with dummy data) and in order for spellbinder to work, the model has to be passed when the view is created, i.e.:
render: ->
new App.RowView(el: '#row', model: foo).render()
Trying to debug the following situation (where I'm probably messing something up) would be easier with more verbose error handling in the console. In the scenario below, I know spellbinder's
data-event
is working as expected:Instantiate new model
Render view for table, then render row view into table
Constructor for row
Model.get works! (yay)
data-bind="name" renders nothing, no error to help debug
It's clear that spellbinder successfully identifies the
data-bind
in the template, but it's tough to tell why it's unable to find foo.name, especially sincemodel.get('name')
works.The text was updated successfully, but these errors were encountered: