我刚刚发现,在最后一个Chrome 42和FF 37.0.2中,这行代码完全合法
"use strict";
var o = { p: 1, p: 2 };
Run Code Online (Sandbox Code Playgroud)
(从MDN复制粘贴)
在IE 10-11和Opera 28.0.1750中,它会按预期抛出错误.
在同一时间,
abc=0;
Run Code Online (Sandbox Code Playgroud)
导致错误(未声明的变量)如预期.
有谁知道是什么导致了这种变化?
我在新的ASP.NET核心项目类型中使用TypeScript.
我们积极使用装饰器.
不幸的是,这会导致VS2015输出中的大量错误:
Error TS1219 Experimental support for decorators is a feature that is subject to change in a future release.
Specify '--experimentalDecorators' to remove this warning.
WebApplication2 d:\documents\visual studio 2015\Projects\WebApplication2\src\WebApplication2\wwwroot\sources\app.ts 9 Active
Run Code Online (Sandbox Code Playgroud)
在常规ASP.NET项目修改*.csproj文件中摆脱这些错误消息非常简单.
但ASP.NET Core项目不使用.csproj,而是使用它.xproj.
那么,如何在ASP.NET Core项目中允许VS2015中的实验性TypeScript装饰器支持?
您可以找到最简单的项目,它可以在github示例代码中重现问题
我正在使用Chart.js(文档),但我似乎无法为甜甜圈路径设置背景颜色.文档中甚至没有提到它.
我想要实现的目标:

当前代码:
var meterInvoicesData = [
{
value: 75,
color: '#22d319'
},
{
value: 25, // rest
color: 'transparent' // invisible (setting this as background color will animate it too)
}
];
var meterOptions =
{
percentageInnerCutout : 80,
animationEasing : 'easeInQuint'
};
var meterInvoices = new Chart(document.getElementById('meterInvoices').getContext('2d')).Doughnut(meterInvoicesData,meterOptions);
Run Code Online (Sandbox Code Playgroud)
更新:我目前通过使用值为100 的复制甜甜圈(第二个画布),没有动画和我想要的(背景)颜色来解决它,并将其定位在第一个下面.
然而,这是一个讨厌的伎俩,效率非常低,所以我仍然希望得到正确答案.