I have this:
var SomeNamespace = {
Model: Backbone.Model.extend(),
View: Backbone.View.extend({
model: new this.Model, //<-- how do I properly create a new object from parent to here?
myMethod: function()
{
alert(this.model.MyName);
}
})
}
Where I added the comment, Model is not defined, I understand why, what I want to know is, how do I access the Model property of the parent?
because the Model is not defined yet, as opposed to other languages, you can not do that in JS. You need to initialize the var to Model in the constructor of the class.