I am wanting to update an @Input property from a child and for the changes to take effect on the parent.
Parent TS (document-details):
export class DocumentDetailsComponent implements OnInit {
view: string = 'editor';
}
Parent HTML (document-details):
<document-content [(view)]="view" ></document-content>
Child TS (document-content):
export class DocumentContentComponent implements OnInit, OnChanges {
@Input() view: string;
ngOnChanges(changes: SimpleChanges) {
if (changes.version) {
this.view = 'editor';
}
}
}
When the view property inside the child component gets set top 'editor' it doesn't seem to reflect these changes inside the parent component.
I know I could use an @Ouput event emitter but I feel like this should work fine.
