Skip to content

Instantly share code, notes, and snippets.

@mkusher
Created July 15, 2014 18:24
Show Gist options
  • Save mkusher/384dcee8a71638b95588 to your computer and use it in GitHub Desktop.
Save mkusher/384dcee8a71638b95588 to your computer and use it in GitHub Desktop.
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