Angular 角式喷油器未通过deps

Angular 角式喷油器未通过deps,angular,Angular,我的喷油器有问题 我构建了一个抽象类,它是自定义组件的基础。这就是为什么对于构造函数,我使用Injector——用于simplyfiy子类 export abstract class SchematerLayout implements OnInit, AfterViewInit { @Input() public form: FormGroup; @Input() public field: IFieldConfig; @ViewChild('fieldComponen

我的喷油器有问题

我构建了一个抽象类,它是自定义组件的基础。这就是为什么对于构造函数,我使用
Injector
——用于simplyfiy子类

export abstract class SchematerLayout implements OnInit, AfterViewInit {
    @Input() public form: FormGroup;
    @Input() public field: IFieldConfig;
    @ViewChild('fieldComponent', {read: ViewContainerRef}) fieldComponent: ViewContainerRef;

    constructor(protected injector: Injector) {
    }

    ngOnInit() {
        const componentResolver = this.injector.get(SchematerComponentResolverService);
        const validationMessagesService = this.injector.get(SchematerValidationMessagesService);
    }
}
问题是
SchematerValidationMessageService
gets always错误
无法解析SchematerValidationMessageService:(?)的所有参数。
SchematerComponentResolversService依赖于同一个服务

这是我的
schematerValidationMessageService
类:

@Injectable()
export class SchematerValidationMessagesService {
    constructor(
        protected configService: SchematerConfigService
    ) {
    }

    getErrorMessage(fieldControl: AbstractControl, fieldConfig: IFieldConfig) {
        //...
    }
}
@Injectable()
export class SchematerComponentResolverService {
    constructor(protected componentFactoryResolver: ComponentFactoryResolver,
                protected configService: SchematerConfigService
    ) {
    }

    createLayoutComponent(type: string) {
        // console.log(type);
    }
}
SchematerComponentResolverService
class:

@Injectable()
export class SchematerValidationMessagesService {
    constructor(
        protected configService: SchematerConfigService
    ) {
    }

    getErrorMessage(fieldControl: AbstractControl, fieldConfig: IFieldConfig) {
        //...
    }
}
@Injectable()
export class SchematerComponentResolverService {
    constructor(protected componentFactoryResolver: ComponentFactoryResolver,
                protected configService: SchematerConfigService
    ) {
    }

    createLayoutComponent(type: string) {
        // console.log(type);
    }
}
我正在使用
forRoot
策略获取提供商:

static forRoot(config: SchematerConfig): ModuleWithProviders {
    return {
        ngModule: SchematerInputModule,
        providers: [
            {
                provide: SchematerConfig,
                useValue: config,
            },
            {
                provide: ANALYZE_FOR_ENTRY_COMPONENTS,
                useValue: config,
                multi: true
            },
            SchematerConfigService,
            SchematerValidationMessagesService,
            SchematerComponentResolverService,

        ]
    };
}

谁能告诉我为什么
SchematerConfigService
可用于第一个服务而不可用于第二个服务?

这意味着
SchematerConfigService
在执行过程中未定义
SchematerValidationMessagesService
类。您很可能有循环依赖关系,但为什么它可以更早地使用?我批准了complete
SchematerValidationMessagesService
类-在github上的最小示例中没有其他依赖创建复制。用户在准备最小复制时经常发现自己的编码问题。问题是我的entryComponents有依赖性。我得做些改变-谢谢