代码从javascript转换为typescript [英] code convert from javascript into typescript

查看:494
本文介绍了代码从javascript转换为typescript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI


我想将angularjs javascript代码转换为typescript。以下是代码片段

 $ scope.sortableOptions = {
update:function(e,ui){
var logEntry = tmpList.map(function (i){
返回i.value;
})。join(',');
$ scope.sortingLog.push(logEntry);
},
stop:function(e,ui){
//此回调具有更改的模型
var logEntry = tmpList.map(function(i){
返回i.value;
})。join(',');
$ scope.sortingLog.push(logEntry);
}
};





任何好友都可以帮助我将此代码转换为打字稿。我是打字稿的新手。



问候

解决方案

scope.sortableOptions = {
update :function(e,ui){
var logEntry = tmpList.map(function(i){
return i.value;
})。join(',');

scope.sortingLog.push(logEntry);
},
stop:function(e,ui){
//此回调具有更改的模型
var logEntry = tmpList.map(function(i){
返回i.value;
})。join(',');


scope.sortingLog.push(logEntry);
}
};





任何好友都可以帮助我将此代码转换为打字稿。我是打字稿的新手。



问候


HI
i wants to convert a angularjs javascript code into typescript. following is the code snippet

$scope.sortableOptions = {
    update: function (e, ui) {
        var logEntry = tmpList.map(function (i) {
            return i.value;
        }).join(', ');
        $scope.sortingLog.push(logEntry);
    },
    stop: function (e, ui) {
        // this callback has the changed model
        var logEntry = tmpList.map(function (i) {
            return i.value;
        }).join(', ');
        $scope.sortingLog.push(logEntry);
    }
};



can any buddy help me to convert this code into typescript. i am new in typescript.

Regards

解决方案

scope.sortableOptions = { update: function (e, ui) { var logEntry = tmpList.map(function (i) { return i.value; }).join(', ');


scope.sortingLog.push(logEntry); }, stop: function (e, ui) { // this callback has the changed model var logEntry = tmpList.map(function (i) { return i.value; }).join(', ');


scope.sortingLog.push(logEntry); } };



can any buddy help me to convert this code into typescript. i am new in typescript.

Regards


这篇关于代码从javascript转换为typescript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆