angularjs绝对类型的Visual Studio 2015年 [英] angularjs definitely typed visual studio 2015

查看:363
本文介绍了angularjs绝对类型的Visual Studio 2015年的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我的第一个项目angularjs到Visual Studio 2015中工作的罚款。安装DefinitelyTyped项目,并获得大量的错误信息。

I'm trying to get my first angularjs project to work within Visual Studio 2015. Worked fine until I tried to move to Typescript. Installed the DefinitelyTyped projects and get lots of error messages.

下面是如何重现它:


  • 创建一个空的ASP.NET应用程序4.5.2

  • 的NuGet AngularJS核心1.4.4

  • 的NuGet AngularJS.TypeScript.DefinitelyTyped 4.1.1(包括jQuery的0.0.1)

  • 添加一个空文件打字稿

  • 添加

  • Create an empty ASP.NET 4.5.2 application
  • Nuget AngularJS Core 1.4.4
  • Nuget AngularJS.TypeScript.DefinitelyTyped 4.1.1 (includes jQuery 0.0.1)
  • Add an empty TypeScript file
  • Add

/// <reference path="typings/angularjs/angular.d.ts" />

该文件。

当我得到444错误,首先这是

that's when I get 444 errors, starting with

Error   TS2411  Property 'find' of type '{ (selector: string): 
IAugmentedJQuery; (element: any): IAugmentedJQuery; (obj: JQuery): 
IAugment...' is not assignable to string index type 'HTMLElement'.  
TypeScript Virtual Projects l:\M\eigene dateien\visual studio 
2015\Projects\WebApplication3\WebApplication3\Scripts\typings
\angularjs\angular.d.ts


任何想法,我做错了,或如何解决呢?

Any idea what I'm doing wrong or how to work around it?

推荐答案

我检查这个包最错误似乎来自jquery.d.ts文件,它只是看起来老了。该文件仍然使用布尔而不是布尔,这是很久以前就重大更改。

I checked this package and most of the errors seem to come from the jquery.d.ts file, which just looks old. That file still uses "bool" instead of "boolean", which was a breaking change made long ago.

我加入jQuery.Typescript.DefinitelyTyped的项目,该项目升级jQuery.d.ts文件到解析正确版本的固定它。当我这样做,所有的编译器错误的走了。

I fixed it by adding "jQuery.Typescript.DefinitelyTyped" to the project, which upgraded the jQuery.d.ts file to a version that parsed properly. As soon as I did that, all of the compiler errors went away.

这似乎是在包装的NuGet创作的错误。我会考虑在github上打开一个问题。

This seems like a bug in the nuget package authoring. I'll look into opening an issue on github.

希望对你有用。

更新:我在GitHub上<开了这一个问题href=\"https://github.com/borisyankov/DefinitelyTyped/issues/5446\">https://github.com/borisyankov/DefinitelyTyped/issues/5446

UPDATE: I opened this issue in GitHub https://github.com/borisyankov/DefinitelyTyped/issues/5446

这篇关于angularjs绝对类型的Visual Studio 2015年的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆