Even in Angular 4.2.4, it works fine in dev mode. But when building the prod ( ng build -prod ) ng build -prod this breaks:
ERROR in Template parse errors: Can't bind to 'step' since it isn't a known property of 'app-textarea-step'. 1. If 'app-textarea-step' is an Angular component and it has 'step' input, then verify that it is part of this module. 2. If 'app-textarea-step' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
My component looks like this:
abstract class StepComponent { @Input() step: BaseStep; @Output() next = new EventEmitter<string>(); @Output() answer = new EventEmitter<Answer>(); } abstract class SingleNextStepComponent extends StepComponent { onSubmit(answer: string) {
Fortunately, a workaround works. The inputs added to the TextBoxStepComponent prevented this from failing, moving on to the next one, the "inputs" have not yet been provided.
But "ng build" works fine without requiring input on @Component decorators ...
source share