reopenpublic
Augments a constructor's prototype with additional properties and functions:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | MyObject = Ember.Object.extend({ name: 'an object' }); o = MyObject.create(); o.get( 'name' ); // 'an object' MyObject.reopen({ say: function (msg){ console.log(msg); } }) o2 = MyObject.create(); o2.say( "hello" ); // logs "hello" o.say( "goodbye" ); // logs "goodbye" |
To add functions and properties to the constructor itself, see reopenClass
Please login to continue.