I noticed that in angular you can define inputs inside the @component decorator
@Component({
selector: 'my-component',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
inputs: ['first', 'last', 'middle']
})
export class ...
But how can one now type the inputs, which you simply can do with @Input
@Input() first: string;
CodePudding user response:
Try this
inputs: ['name', 'id: number'],
This is a string array by default. Now, create your property in class as
id: number
(without @Input)