Hey All,
I'm just wondering how UI5 hides Javascript Object's prototype property !! I was just playing around with UI5 controls and encountered this.
- Created a method 'Move' in the prototype of sap.m.Button.
- Created a new instance for the Button 'oButton'.
- oButton instance doesn't have the method Move which it is supposed to have.
sap.m.Button.prototype.Move=function(){
console.log('Move');
}
var oButton =new sap.m.Button({text:"Hello"});
oButton.Move();// throws undefined function!
The Most interesting thing is the same code when executed in Browser console, works like a charm !
How is this possible ?