Hi guys,
On the UI, I have a button to which I have attached a controller method to handle.
But in that method, "this" points to the button triggering the press event. But I want to get controller object, so I figure out a way to achieve that.
Here's the code:
sap.ui.controller("view.Players",{ me:{}, onInit:function(){ me = this;// in init , I assign this(controller object) to me property. }, // this is the press event handler addPlayer:function(){ me.dosomething(); } )}
I just don't know whether there's a easier way to achieve that?
And I'm kinda confused by my own code, why is it possible to access me in the addPlayer method?