简体   繁体   English

如何在 TypeScript (Angular 2) 中制作多行注释

[英]How to make comment multi line in TypeScript (Angular 2)

i have a problem to make comment multi line in typescript angular 2. I just want to comment this code :我在打字稿 angular 2 中进行多行注释时遇到问题。我只想注释此代码:

    protected _checkingList(data, lists:Array<any>){
    let value = false;
    //if (data['__children'].length > 0){
    //    value = this.percobaanCentangMajuMundukCantik(data, data['__children'],data['__children'].length);
    //}
    if (data.value == true){
        value = true;
    }

    return value;
}

symbol "//" is the single comment in typescript, i want to make multiline comment, does anyone know how to make it ?符号“//”是打字稿中的单条注释,我想做多行注释,有谁知道怎么做?

The following is a multiline comment: 以下是多行注释:

/* */

It uses the same commenting syntax as vanilla javascript. 它使用与香草javascript相同的注释语法。

I think you can wrap your code with /*your code here*/ 我认为您可以使用/*your code here*/包装您的代码/*your code here*/

protected _checkingList(data, lists:Array<any>){
    let value = false;
    /*if (data['__children'].length > 0){
        value = this.percobaanCentangMajuMundukCantik(data, data['__children'],data['__children'].length);
    }*/
    if (data.value == true){
        value = true;
    }

    return value;
    }

使用^ + /将多行代码转换为打字稿中的注释,以在注释中切换代码

@Andrew Eisenberg already answered to add more info incase anyone needs it. @Andrew Eisenberg 已经回答添加更多信息以防万一有人需要它。

Block Comment阻止评论

/*
 * This is a 
 * Block Comment
 */

select the text and press: Shift + Alt + A Block Comment: Shift + Alt + A选择文本并按:Shift + Alt + A 块注释:Shift + Alt + A

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM