I have a component parentComponent having property 'model'
I pass part of the model into my child component using @Input binding:
<item-list
[items]="model.items.available"
[filter]="model.items.selected"
[selected]="model.properties.selected"></item-list>
export class ItemListComponent {
private el: HTMLElement;
@Input('items') items: Item[];
@Input('filter') filter: Item[];
@Input('selected') selected: Object;
the property gets displayed in parent:
{{model.properties.selected.label}}
but if i modify it in the child component:
itemClicked(item: Item, index: number) {
this.selected = item;
return true;
}
the item gets modified in the child but no change is made to the displayed
value in the parent, but i push one item from items to filter; the change
gets propagated. What am I doing wrong? I am noob with A2.
Thanks in advance,
Jan
--
You received this message because you are subscribed to the Google Groups
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.