javascript oop and this
-
12-11-2019 - |
Question
Given the following code:
JE.events = {
self: this,
controller: {
init: function(){
$(".monthheader").click(function () {
JE.events.model.get($(this).attr('title'));
return false;
});
return this;
}
},
model: {
get: function(monthnum){
...
}
}
}
How would i replace the call to
JE.events.model.get(..);
by something like
self.model.get(..);
The whole code is more or less in this gist https://gist.github.com/966270 . The idea is to create a really simple MVC in js (my first attempt) that i can reuse easily. Improvements are welcome!
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow