0

Javaでsuperのように、子どものanchestor関数をどのように呼び出すのですか?合金コントローラの継承でsuper()を使用する方法

parent.js

exports.test = function(){ 
    Ti.API.info('Parent Function'); 
} 

child.js

exports.baseController = 'parent'; 

exports.test = function() { 
    // super.test(); <-- should print "Parent Function" 
    Ti.API.info('Child Overriden Function'); 
} 

Appceleratorの合金継承:http://docs.appcelerator.com/platform/latest/#!/guide/Inheritance

答えて

0

これを使用してください。スーパーの代わりに。

this.test(); 
+0

試してみてください。解決策は機能しません。 –

+0

これを子関数で使用すると実際には無限再帰ループが発生します –

+0

誰かが答えを探して落ちる場合に備えて '$ .test()'を使います –

関連する問題