在自己的组件中使用内部 Clarity 服务

Use internal Clarity services in own components

我正在尝试编写自定义表单控件包装器组件,例如Clarity 的 clr-input-container 用于我已经实现的自己的表单控件。对于包装器,我想使用实用程序服务 IfErrorServiceNgControlServiceControlIdServiceControlClassServiceLayoutService,就像在 clr-input-container 中完成的那样执行。

但是我在每项服务中都遇到了这些构建错误:

ERROR in ./.../my-control-container.component.ts
Module not found: Error: Can't resolve '@clr/angular/forms/common/if-error/if-error.service' in '/.../my-control-container'

有什么方法可以在我自己的项目中使用内部 Clarity 服务吗?

我们目前不会故意公开导出此信息,因为它目前特定于我们的表单。我们想通过创建一个通用的输入容器来解决这个问题,供您利用。目前还没有进行,所以我没有时间表。

我建议的唯一解决方法是您可以将服务复制到您的项目中并重新声明它们,就像您在输入实现中看到的那样。您必须确保一切都正确连接,这不是我们记录的内容,因此不一定清楚它是否与您正在处理的内容兼容。