Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
Typescript 泛型 keyof 与类型不匹配
我有这个接口 它只存储另一个接口的密钥 modelKey 和该键的值 value interface ValueHolder
typescript
typescriptgenerics
如何测试 Angular2 中是否存在路由?
在 Angular2 中如何检查路由是否存在 我有一种方法可以记住如果用户未经授权则导航到哪条路线 登录时我有 this router navigate this authService redirectUrl 但我只想在redirectU
angular
typescript
angular2routing
如何使用 Jest 单元测试覆盖 TypeORM @Column 装饰器?
我希望尽可能多地对我的应用程序进行单元和端到端测试 我的目标是覆盖率达到 101 我的设置现在的问题是 typeorm 的 Column 装饰器使用箭头函数来设置默认值 例如数据库更新的当前时间戳 这个箭头函数没有被玩笑测试覆盖 消息是 s
typescript
unittesting
jestjs
NESTJS
TypeORM
如何在打字稿中使用不同类型的通用键输入对象
您将如何在打字稿中输入这些对象 我有一个特殊的 日期时间 键 即日期 其余键是数字 但我事先并不知道每个对象上将设置哪些键 示例值 type Metrics const example1 Metrics datetime new Date
typescript
typescripttypings
Angular 6 - 无法解析AppComponent的所有参数
我正在尝试使用 Angular 6 构建一个应用程序 但我仍在设置一切 但我的应用程序中的依赖注入似乎有问题 它无法解析任何构造函数参数 它们都导致Uncaught Error Can t resolve all parameters fo
angular
typescript
dependencyinjection
angular6
ngxtranslate
Typescript 实现接受多种类型输入的通用函数
出于抽象目的 我需要实现一个接受不同类型输入的函数 type ContentA string type ContentB number type InputA name method a content ContentA type Inpu
typescript
typescriptgenerics
typeinference
可以使用 Babel 转换为 TypeScript 吗?
我明白巴别塔现在支持 TypeScript https github com babel babel tree master packages babel preset typescript样式类型注释 但是 它不会像 TypeScript
javascript
typescript
babeljs
componentDidMount 生命周期方法中子组件抛出的错误未在错误边界中捕获
我正在学习 React 当 API 服务器不可用时 无法获取错误边界来捕获子组件中 axios http 请求引发的网络连接错误 我可以看到错误记录在子组件的 catch 处理程序中 但是 ErrorBoundary 组件没有捕获 thro
ReactJS
typescript
axios
HERE 地图 JS API 3.1 - Angular 中样式组“非碰撞”错误
在使用卫星基础层加载 HERE 地图时 有时会出现此错误 Tangram error Error for style group non collision for tile 13 16 15542 12554 15 Cannot read
angular
typescript
hereapi
Tangram
如何使webpack 5.x src路径是项目真正的src路径而不是webpack配置文件根路径
我在配置中配置 webpack src 路径 如下所示 path resolve dirname src 看来webpack没有找到真正的项目src路径 源路径是 web pack 配置路径 现在我得到这样的路径 Users xiaoqia
typescript
webpack5
在 Material Angular 中显示一个简单的警报对话框
我正在使用材质角度 来自角材料 https material angular io 该网站中的示例似乎有点过于复杂 互联网上的所有其他教程似乎要么已经过时 要么正在使用 AngularJS 如何显示一个带有标题 消息和确认 取消按钮的简单警
angular
typescript
angularmaterial2
打字稿中具有数据水合/脱水的类
我想分享 React TS 前端和 Node TS 后端之间的 TS 类或接口 问题是 TS 类型在编译时被剥离 所以当我想将类实例转换为 JSON 时我无法使用它们 我想知道是否有任何解决方案可以在静态文件中描述我的对象 生成 TS 类
nodejs
typescript
hydration
从 RxJS Observable 中过滤未定义的内容
是否有特定的习惯用法或实用程序用于过滤undefined从 RxJS 可观察到的 这段代码具有我想要的行为 obs pipe filter x gt x undefined 一些替代方案是 obs pipe filter x gt x fo
typescript
rxjs
zod TypeError:无法读取未定义的属性(读取“_parse”)
我有一个使用 Zod 的 Vite 库 我想解析配置 我的文件夹结构与配置对象结构类似 index ts文件始终导出其自己目录中的所有文件及其子目录中的所有内容 例如export from subDir 所以根文件导出 整个库 以下设置显示
javascript
typescript
zod
Angular Material Table - 如何更新现有表的列标题?
我正在使用 Angular 7 我有一个简单的组件角材料表 https material angular io components table overview 通过某些事件 例如单击鼠标 我希望能够更新现有表的数据和标题 Before
angular
typescript
angularmaterial
angularmaterialtable
将对象属性限制为 keyof 接口
此代码将无法编译 interface IFoo a number type TFoo keyof IFoo type OFoo key TFoo any let obj OFoo a 1 我想要实现的是 obj 只能与具有有效属性的对象一起
typescript
突出显示搜索文本 - 角度 2
信使根据用户给出的输入显示搜索结果 在显示结果时需要突出显示搜索到的单词 这些是所使用的 html 和组件 组件 html div div Id result id div div Summary result summary div di
javascript
angular
html
typescript
Angular 2 TypeScript 如何在数组中查找元素
我有一个组件和一个服务 成分 export class WebUserProfileViewComponent persons Person personId number constructor params RouteParams pr
angular
typescript
angular2services
npm 依赖冲突
我正在使用 Vue 开发一个项目 我运行 Vue Cli 并添加了 Typescript 插件 我有几个弱点 当我跑步时npm audit fix它无法解决依赖冲突 npm ERR code ERESOLVE npm ERR ERESOLV
typescript
vuejs
npm
audit
npmvulnerabilities
如何跨角度模块正确导入/导出类?
这个问题来自于企业应用的背景 从我读过的所有书籍和我见过的关于角度应用程序的在线示例中 每次我们创建一个类 组件 服务 实体等 时 我们都会在类型定义上导出它们 然后在需要的地方直接导入它们引用 类似于在 C 上使用命名空间 无论两个类属于
angular
typescript
ECMAScript6
«
1 ...
90
91
92
93
94
95
96
...100
»