2013-01-14 54 views
0

應該工作嗎?是一個數組的函數簽名

interface MyInterface{ 
} 

class MyClass { 
    DoSomething(callback: (MyInterface[]) => void) { 
     ... 
    } 
} 

編譯器不喜歡該參數是MyInterface的數組。

回答

5

你缺少參數名:

interface MyInterface{ 
} 

class MyClass { 
    DoSomething(callback: (arg:MyInterface[]) => void) { 
    } 
} 
相關問題