所以我有一个表格组件。但是表组件需要使用适当的 API 服务,具体取决于它是由 ComponentA 还是 ComponentB 调用。
例如,如果 ComponentB 使用 TableComponent,那么它需要让 TableComponent 注入 APIForB 服务并使用它来填充表。
角度新手,所以不确定这样的事情是否可能。
dependency-injection angular-services angular-components angular
angular ×1
angular-components ×1
angular-services ×1
dependency-injection ×1