I\'m just learning about how to best organize my javascript code, and I had a question regarding this small piece of code I wrote:
var reportsControllerIndex = {
plotMapPoints: function(data) { //plots points }.bind(this)
when defining your function you can just add .bind(this) to set the correct context for that function.