I'm doing the official Tour of heroes tutorial on Angular 2. They pass an object into the target of another component:
<my-hero-detail [hero]="selectedHero"></my-hero-detail>
As far as I understand, [hero]="selectedHero" means one way binding the object reference. Thus, any modifications to hero within my-hero-detail will also affect selectedHero, since they reference the same object.
How can I enforce literal one way binding, like passing a deep? shallow? copy of selectedHero to my-hero-detail?
In Angular 1.5, you can allegedly declare one way binding attributes in components: scope: { hero: '<' }. Is this missing in Angular 2?
--
I assume this was implemented by design, so we actually work by reference and copy only those properties that are needed.