如何在Typescript中将类名用作通用参数

时间:2018-06-26 06:17:11

标签: typescript generics

我的代码如下所示

$name = array([0] => nithya.sreeraman [1] => jaivignesh.parthiban [2] => aadhil.ahmed 
[3] => aarthe.sathyanaraya [4] => abdulamjad.babu [5] => khaja.hussain 
[6] => abdulwahab.mohamed [7] => abdullasha.pari [8] => abinaya.sambandam 
[9] => abinesh.pugazhendhi);

$i = 0;
// Loop through assoc name array
foreach($name as $key => $value){
    $arrName[$i] = $value;
    $i++;
}

如何使用通用参数编写此代码

deserialize(myClass: MyClass) : MyClass {
    return Utils.deserialize(MyClass, myClass);
}

0 个答案:

没有答案