Is mutating an input param in a child component fine or should all input objects be considered read-only & then emit event for any changes back to parent & delegate the change to parent component? Are there any problems that could arise out of modifying input params.
class ChildComponent {
@Input() parentParam;
@Output() clickValEvent = new EventEmitter<boolean>();
let parentParamClone = Object.assign({}, parentParam);
childClickEvent(val) {
//Update value locally.
// parentParam.clickVal = val;
//Inform parent & let it do necessary change.
// this.clickValEvent.emit(val);
//Only play with local clone.
// parentParamClone.clickVal = val;
}
}