We are currently in the process of building an angular application with Angular 5.
Typically, our components have input and output parameters defined as shown below:
export class MultipleItemPickerComponent implements OnInit {
@Input() itemPickerHeaderText: string;
@Output() multipleItemsPickerOkClick: EventEmitter<string[]> = new EventEmitter();
@Output() multipleItemsPickerCancelClick: EventEmitter<Event> = new EventEmitter();
In the template file for this component, it is used in the following manner:
<app-multiple-item-picker itemPickerHeaderText="{{question.texts['reason']}}" (multipleItemsPickerOkClick)="multipleReasonsPickerOkClick($event)" (multipleItemsPickerCancelClick)="multipleReasonsPickerCancelClick($event)"></app-multiple-item-picker>
Everything runs smoothly as intended.
However, there is a possibility within the same class to modify the input value to something other than its original value.
removeItemClick() {
this.itemPickerHeaderText = "something completely different";
}
I am seeking a way to prevent any alterations to the input values. Is there a solution for this?