How does one write HTML to populate a complex @Input parameter in Angular?
If I have an Angular Component like this:
@Component({
selector: 'app-one',
templateUrl: './one.component.html',
styleUrls: ['./one.component.css']
})
export class OneComponent implements OnInit {
@Input() data: MyCustomType;
...
export class MyCustomType {
id: string;
value: number;
}
Can I write HTML to populate it?
Something in the lines of:
<app-my data="{'id':'a','value':1}></app-my>
There is no problem populating it through Typescript, as is the normal case, but in this case I want to populate it from HTML alone.