У меня 2 сервиса:
- service_category.service.ts
- service.service.ts
Как обратиться к функции clearCategory, которая находится в import { ServiceService } from '../service/service.service';
Импорты, экспорты в модулях настроил.
service_category.service.ts :
import { ServiceCategory, ServiceCategoryDocument } from './service_category.models';
import { ServiceService } from '../service/service.service';
@Injectable()
export class ServiceCategoryService {
constructor(@InjectModel(ServiceCategory.name) private ServiceCategoryModel: Model<ServiceCategoryDocument>) {}
const servicesThisCategory = await ServiceService.clearCategory(deletedServiceCategory.name);
return '';
}
}
service.service.ts :
@Injectable()
export class ServiceService {
constructor(@InjectModel(Service.name) private ServiceModel: Model<ServiceDocument>) {}
async clearCategory(nameCategory: string): Promise<any> {
return '';
}
}
Сейчас такая ошибка: