저는 각도 2/4를 사용하고 있습니다. 필자는 해당 기능에 해당하는 모든 것을 포함하는 기능 모듈을 보유하고 있습니다. 예를 들어 빌딩 모듈과 클라이언트 모듈이 있습니다.다른 기능 모듈에서 서비스에 액세스하는 방법은 무엇입니까?
이것은 본질적으로 내 클라이언트 기능 모듈에 대해 동일한 구조이다.
이제 Building Building과 관련된 클라이언트 목록이 필요하므로 내 건물 모듈에서 ClientService에 액세스해야합니다. 이처럼 클라이언트 서비스를 가져올 수 있습니까?
import { BuildingService } from "../buildingservice";
import { ClientService } from "../../client/clientservice";
@Component({
selector: 'building-detail',
templateUrl: './building-detail.component.html',
providers: [BuildingService, ClientService]
})
export class BuildingDetailComponent extends ComponentBase {
constructor(private buildingService: BuildingService, private clientService: ClientService) {
super();
}
}
내 ClientService를 SharedServices 폴더에 두거나 좋을까요?