ChildComponent.ts
export class ChildComponent implements OnInit {
@Input() name?: string;
@Input() email?: string;
// Many more properties
constructor() {}
ngOnInit(): void {}
}
ParentComponent.ts
export class ParentComponent implements OnInit {
childProps = {
name: "johnny",
email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b1dbded9dfdfc8f1d6dcd0d8dd9fd2dedc">[email protected]</a>"
};
constructor() {}
ngOnInit(): void {}
}
ParentComponent.html
This setup function as intended:
<app-child [name]="childProps.name" [email]="childProps.email"></app-child>
Is there a way to pass all properties using the ES6 spread operator?
<app-child [*]="{...childProps}"></app-child>