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
Classes in ES6 require super() to be called before you can use this in a constructor (now enforced in Babel 5.x), but todo-app.js needs to do this a few times to support property values such as this.events and this.tagName. Is there a way to refactor this so the properties can be initialized after calling super() (though so far I haven't been able to think of a way this would work with Backbone out of the box)?
I am having the exact same issue. I have not found a solution but the only thing I came up with is calling super() twice. Once immediately after construct() so this is available and then super() towards the end of construct() to initialize the this.events and this.tagName properties after they have been set. This just seems like a wrong way to make it work but I have not found another solution on the internet.
Classes in ES6 require
super()
to be called before you can usethis
in a constructor (now enforced in Babel 5.x), buttodo-app.js
needs to do this a few times to support property values such asthis.events
andthis.tagName
. Is there a way to refactor this so the properties can be initialized after callingsuper()
(though so far I haven't been able to think of a way this would work with Backbone out of the box)?[UPDATE] Relevant Backbone issue: jashkenas/backbone#3560
The text was updated successfully, but these errors were encountered: