import {Component, Input} from 'angular2/core';
import {Transport} from "./models/Transport";
@Component({
selector: "child",
template: `<h2>In Child Component</h2>
<h3>Electric Cars</h3>
<br/>
This is not an ideal solution: <b>transport.cars[0].electrics[1].name</b> yields:
<br/>
{{electricCar}}
`
})
export class ChildComponent {
@Input() transport: Transport;
ngOnChanges() {
this.electricCar=this.transport.cars[0].electrics[1].name;
}
}
Thank you, Gunter, for your thoughtful answer. It's a great source of comfort to find helpful folks to share their expertise. I see that your solution works, but for my situation, Sander has revealed to me a nice way dirty-check my arrays.