简体   繁体   中英

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 :

    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.

I think you can wrap your code with /*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.

Block Comment

/*
 * This is a 
 * Block Comment
 */

select the text and press: Shift + Alt + A Block Comment: Shift + Alt + A

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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