angular - Angular 2+中组件类的Typescript中的类型是什么?
问题描述
我有一个小问题,但很大的挫败感。对于我的自定义模块,我需要传递一组组件。所以...为了保持良好的习惯,我想用 Typescript 来描述它。它看起来像这样:
export interface ModalModuleConfig {
title: string;
z-index: number;
entryComponents: Component[];
}
但Component[]
不是合适的类型。它仅适用于any[]
. 但我不想偷工减料使用any[]
. 我更喜欢使用为角度组件创建的类型。之类的东西Component[]
,ComponentDecorator[]
或ComponentClass[]
。但它们都不起作用。有人能帮我吗?
解决方案
推荐阅读
- php - 密码哈希和在 Codeigniter 中
- angular6 - 如何在角度 6 中设置应用程序变量?
- makefile - 找不到支持的 mac sdk:[“10.10”“10.11”“10.12”“10.13”]
- javascript - jQuery .click 方法不会为列表项触发
- r - 如何绘制彩色编码密度散点图的图例?
- django - Django 传单画布
- php - 在mysql中按状态值1排序并按名称排序asc记录
- c# - 无法使用实例调用方法
- jmeter - badboy 在 localhost Url 中执行 Ui 录制测试时显示空 Url
- geometry - 确定弧是代表反射角还是锐角