Targeting ES5 with TypeScript in Visual Studio

后端 未结 5 957
名媛妹妹
名媛妹妹 2020-12-06 04:31

I would like to use get/set syntax in TypeScript within Visual Studio Express for Web. How do I enable this. I currently get this error when compiling;

5条回答
  •  死守一世寂寞
    2020-12-06 04:48

    This has changed with TypeScript 0.8.2. You now change TypeScriptTarget in the .csproj file from:

    ES3
    

    to

    ES5
    

    MyApp.csproj:

      
        ES5
        true
        true
        AMD
      
    
      
        ES5
        false
        false
        AMD
      
    

    See also Asher Barak answer

提交回复
热议问题