estoy haciendo encadenamiento selecciona con Backbone.js por este artículo http://blog.shinetech.com/2011/07/25/cascading-select-boxes-with-backbone-js/, pero tiene errores, al extender las clases.Backbone.js - CoffeeScript extiende
lo tanto, tengo clase LocationsView:
class Blog.Views.LocationsView extends Backbone.View
events:
"change": "changeSelected"
clase CountriesView: Clase
class Blog.Views.CountriesView extends Blog.Views.LocationsView
setSelectedId: (countryId) ->
CitiesView:
class Blog.Views.CitiesView extends Blog.Views.LocationsView
setSelectedId: (cityId) ->
Pero cuando el código CoffeeScript compilado tener JavaScript mis dobles clases extendidas miradas como:
(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
cities_view.js:5 Uncaught TypeError: Cannot read property 'prototype' of undefined
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
Blog.Views.CitiesView = (function() {
__extends(CitiesView, Blog.Views.LocationsView);
function CitiesView() {
CitiesView.__super__.constructor.apply(this, arguments);
}
CitiesView.prototype.setSelectedId = function(cityId) {};
return CitiesView;
})();
}).call(this);
y me dieron error:
Uncaught TypeError: Cannot read property 'prototype' of undefined cities_view.js:5
Por lo tanto, el origen del problema y cómo solucionarlo?
¿Podría proporcionar el seguimiento completo de la pila? – thejh