typescript 相关问题

TypeScript是由Microsoft创建的JavaScript的类型超集,它添加了可选类型,类,接口,async / await和许多其他功能,并编译为纯JavaScript。此标记用于特定于TypeScript的问题。它不用于一般的JavaScript问题。

typescript。该函数的返回类型可能与指定的类型不匹配 我对函数的简单类型有问题: 键入typeTest

type TypeTest<K, T> = (a: K) => T; const foo: TypeTest<{x: string}, {y: string}> = a => ({ y: '1', s: 1, }); <{x: string}, {y: string}>

回答 1 投票 0


创建Angular应用而无需使用Angular-Cli

夜。 谁能给我说明(或链接到文章)如何从头开始创建Angular Project 4,而不使用Angular-CLI? 谢谢

回答 1 投票 0


用cheerio

这是我的HTML代码:

回答 1 投票 0





我正在通过TypeScript

type Mapish = { [k: string]: boolean }; type M = keyof Mapish;

回答 1 投票 0




我将tsconfig.json发布到npm是否?

TSC最近启动了tsconfig.tsbuildinfo文件。我现在将其添加到.npmignore,以防止我将其发布到NPM,因为它们是为了跟踪本地构建的工件。

回答 1 投票 0

如何在小叶路由机上添加标记机

plotRoute(): void { if (this.selectedOrder) { this.primengTableHelper.showLoadingIndicator(); this._itsHttpService.GetOrder(this.selectedOrder.orderId).subscribe({ next: (results) => { const pickup = results['stops'].find((stop: any) => stop.isPickup); const dropOff = results['stops'].find((stop: any) => stop.isDropOff); if(!pickup && !dropOff && !this.mapAdmin){ this.primengTableHelper.hideLoadingIndicator(); return; } if(this.routingControl){ this.mapAdmin.removeControl(this.routingControl) } this.routingControl = L.Routing.control({ waypoints: [ L.latLng(pickup.location.latitude, pickup.location.longitude), L.latLng(dropOff.location.latitude, dropOff.location.longitude), ], routeWhileDragging: true, createMarker: (i: number, waypoint: L.Routing.Waypoint, n: number) => { } }).addTo(this.mapAdmin); this.primengTableHelper.hideLoadingIndicator(); }, error: (err) => { console.error('Failed to load order details:', err); this.notify.error(this.l('FailedToLoadOrderDetails')); this.primengTableHelper.hideLoadingIndicator(); }, }); } } createIcon(label: string): L.DivIcon { return L.divIcon({ className: 'custom-marker', html: `<div style="background-color: black; color: white; padding: 5px; border-radius: 50%;">${label}</div>`, iconSize: [20, 20], }); }

回答 1 投票 0

无法将.ts文件与茉莉和业力一起使用。获取错误“无法确定文件类型。”

我确实需要一些帮助来配置karma.conf.js来处理输入文件,或者不确定缺少什么或我在这里做错了什么。对单位测试和学习茉莉框架的新手...

回答 2 投票 0


为什么如果语句更改我的类型定义?

,但是我正在尝试重写打字稿中的代码以更好地理解它。

回答 1 投票 0

从Google日历事件中进行的Expand Recisurrence规则

在此报告,Google日历API的事件可以在RFC5545之后具有复发规则。 我找到了一种简单的方法来扩展遵循打字稿的规则:在简单的wor中...

回答 1 投票 0

找不到模块“ cookie-session'

[auth] [错误] 09:55:34⨯无法编译打字稿:

回答 0 投票 0

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.