- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最新的 WebStorm10.0.2
引发关于 "angular2.d.ts"
的错误,即“需要新行或分号。”在第 15-19 行和第 32-37 行。
Angular2 团队在 5 分钟开始的例子中犯了错误?我不敢相信,这一定是我的错。
所以:
我按照“angular2 的 5 分钟快速启动”( https://angular.io/ ) 逐步克隆。
我已经将“index.html”和“app.ts”从“complete”移动到基本路径。
我还将我的 WebStorm10.0.2
编译器版本更改为包含 typescriptService.js 的自定义目录。
还是不行...
我的 typescript 版本是 1.5Beta。
interface List<T> extends Array<T> {
}
interface Type {}
declare module "angular2/angular2" {
function bootstrap(appComponentType: any): void;
function Component({
selector,
properties,
hostListeners,
injectables,
lifecycle,
changeDetection
}:{
selector:string,
properties?:Object,
hostListeners?:Object,
injectables?:List<any>,
lifecycle?:List<any>,
changeDetection?:string
});
function View({
templateUrl,
template,
directives,
formatters,
source,
locale,
device
}: {
templateUrl?: string,
template?: string,
directives?: List<Type>,
formatters?: List<Type>,
source?: List<any>,
locale?: string,
device?: string
});
function For();
function If();
}
最佳答案
在命令行中通过tsc -v
检查您的tsc
版本,看看结果是否为1.5.0-beta
。您使用的可能是早期版本,因为您的系统中安装了多个版本(一个通过 npm,另一个可能是在您安装某个版本的 Visual Studio 时)。
要检查 tsc
的安装版本(如果您在 windows 环境中)使用命令行并键入 where tsc
,结果将是一个目录列表如果你有比 npm 多的目录,只需转到你的 Path 系统变量并删除它们。
一定要打开一个新的命令行以便再次测试 tsc
,因为旧的路径变量不会为已经打开的命令行刷新。
关于angular - typescript angular2.d.ts错误 "Expecting new line or semicolon",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30032149/
给定这些字符串: 1;2;3 2;1;3 2;3;1 我需要匹配/找到其中的1(为了简单起见,1可以是任何字符串)。 想出了这个模式作为部分解决方案,目前满足我的需要(因为它在 regexp.test
关于 Io home page它提到了它的小尺寸,但它使用了我以前从未见过的度量单位: small vm (~10K semicolons) 这只是字符(~字节)的大小,还是这里发生了更微妙的事情?
我有以下存储过程。这是给我一些错误 DROP procedure IF exists getQueueMessage; DELIMITER $$ CREATE DEFINER=`root`@`loca
我对一个非常简单的例子感到困惑。我有一个标准列表,因此基本上它的字符串表示形式使用分号作为分隔符。我想用另一个替换它: set(L1 "A" "B" "C") message("L1: ${L1}")
在某些情况下,在单个 JavaScript 文件中包含多个自调用函数会引发错误。让第二个函数返回一个值可以避免错误。 我有一个简单的 HTML 文件... ...使用这些脚本: // two.js
我在 VSCode 中使用 jshint。 jshint 在下面函数的末尾 '}' 处给出“缺少分号”警告 void function doSomething(){ console.log('
正在尝试创建“MortgageData”对象的新实例。 教授说要用: ClassName InstanceName = New ClassName(arg1, arg2, arg3, arg4); 我
同时关注 rustbyexample.com教程中,我输入了以下代码: impl fmt::Display for Structure { fn fmt(&self, f: &mut fmt:
我需要一个正则表达式在具有以下结构的 C# 应用程序中使用: 以分号分隔的域名 有效示例: domain1.com;domain2.org;subdomain.domain.net 我怎样才能用一个正
这个问题在这里已经有了答案: "Uncaught TypeError: undefined is not a function" in JavaScript code block (2 个答案) 关
上周我将 Aptana Studio 更新到最新版本(Aptana Studio 3,内部版本:3.4.2.201308081805)。现在到处都显示警告,提示我的 JS 文件中缺少分号。我知道这些在
今天,在搜索了半个小时的错误后,我发现可以将分号放在if语句后面,而不是代码后面,如下所示:。这基本上意味着,无论a是否等于b,都会完成,而if语句没有任何意义。为什么Java不给我一个错误呢?在什么
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
我知道当 grouping commands in bash 时圆括号 () 和花括号 {} 之间的目的区别. 但为什么花括号结构在最后一个命令后需要一个分号,而对于圆括号结构,分号是可选的? $ w
这是关于解析 HTML 的内联 CSS 样式属性。我正在使用 JSoup,但据我所知,JSoup 已选择不对此提供帮助……我不确定为什么。这意味着用户必须找出键和值等中合法字符的规则,即什么构成了“正
在我下面的代码中,我得到了这个编译器错误 error C2236: unexpected 'class' 'Pawn'。您是不是忘记了一个“;”? 但是正如您清楚地看到的那样,我没有漏掉一个分号……是
这个问题有点开玩笑,但我也很好奇正确和最干净的方法来做到这一点。 背景:Kurt Vonnegut 说分号是毫无值(value)的标点符号。他们所做的只是表明你上过大学。 无论如何,我知道如果我有一个
这个问题在这里已经有了答案: What are invalid characters in XML (15 个答案) 关闭 6 年前。 我是一个新手,正在尝试将 XML 从外部第三方导入到 SQL
我有这个示例代码,我在其中定义了一个数组,但它没有编译: $ cat a.go package f func t() []int { arr := [] int { 1,
我必须训练一个算法,使用提供的数据集来评估葡萄酒。但是,数据集将所有数据聚集在一列中(用分号分隔),我不确定如何对它们进行拆分。。这是数据当前格式的输出:我尝试了下面的代码和其他一些东西,但它将它们都
我是一名优秀的程序员,十分优秀!