Last active
August 29, 2015 14:01
-
-
Save atannus/b2731427b6e90059651e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a.js | |
//goog.provide('myapp.A'); | |
myapp.A = function() {} | |
myapp.A.prototype.move = function() { | |
console.log('moveA'); | |
} | |
// b.js | |
//goog.provide('myapp.B'); | |
//goog.require('myapp.A'); | |
myapp.B = function() {}; | |
goog.inherits(myapp.B, myapp.A); | |
myapp.B.prototype.move = function() { | |
goog.base(this, 'move'); | |
console.log('moveB'); | |
} | |
// Create a B | |
b = new myapp.B(); | |
// Call move on B outputs: | |
// 'moveA' | |
// 'moveB' | |
b.move(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment