Created
July 15, 2014 18:24
-
-
Save mkusher/384dcee8a71638b95588 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
var ComponentA = Component.extend({ | |
param1: 'aaa', | |
f1: function(){ | |
console.log(this.param1); | |
} | |
}), ComponentB = ComponentA.extend({ | |
param1: 'bbb', | |
param2: 'bbbb', | |
f2: function(){ | |
this.f1(); | |
console.log(this.param2); | |
} | |
}), ComponentC = ComponentB.extend({ | |
param2: 'cccc', | |
param3: 'ccccc', | |
f1: function(){ | |
this.__PARENT__.f1(); | |
this.f3(); | |
}, | |
f3: function(){ | |
console.log(this.param3); | |
} | |
}), | |
objectA = new ComponentA, | |
objectB = new ComponentB, | |
objectC = new ComponentC; | |
console.log(objetcA, objectB, objectC); | |
objectA.f1(); // aaa | |
objectB.f2(); // bbb bbbb | |
objectC.f2(); // bbb ccccc cccc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment