gpt4 book ai didi

javascript - 我在哪里可以找到 angularjs typescript 的 api 引用?

转载 作者:行者123 更新时间:2023-11-30 11:32:15 25 4
gpt4 key购买 nike

我以前使用 Angularjs 1.4 和纯 javascript,现在我开始使用 Angularjs 1.5,但现在使用 Typescript,我找不到文档来帮助我。例如,我必须猜测服务的名称,如 $q$timeout 才能注入(inject)到我的类中。那将分别是 angular.IQServiceangular.ITimeoutService

我希望能说清楚。谢谢

最佳答案

DefinitelyTyped 存储库包含 readme file连同各自的 AngularJS 定义,

All known services interfaces have been defined, and were named using the following convention:

I + 'ServiceName' + 'Service'

So, for instance, the $parse service has it's interface defined as ng.IParseService.

Service providers, by the same logic, follow this convention:

I + 'ServiceName' + 'Provider'

The $httpProvider, thus, is defined by ng.IHttpProvider.

找出类型最直接的方法是查看源文件,本地 @types 包或 DefinitelyTyped repo . TypeScript 最适合与 IDE 一起使用,在 IDE 中可以检查输入并自动完成,而无需任何文档。

此外,可以使用 AngularJS 类型自动生成的文档 here .

关于javascript - 我在哪里可以找到 angularjs typescript 的 api 引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45789153/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com