![image or error ]1Encountering a strange issue in my Angular 4 application. When I type in input text boxes, an error message
TypeError: this.changeHook is not a function
appears in the console. I'm struggling to understand the cause of this error. Any suggestions?
****UPDATE**** The error seems to occur only for the second input text box and not the first one. Curiously, every character I type in the second box triggers the same error message multiple times in the console.
HTML
<ng-container *ngFor="let reasoncode of displayReasonCodes$ | async;let i = index">
<tr class= "row-break">
<checkbox type="checkbox" name="sizecb[]" value="{{reasoncode.id}}" [(ngModel)]="reasoncode.state">
</checkbox>
<td>
<form>
<form-group>
<textbox [readOnly]="isEditable" ngModel="{{reasoncode.ReasonCode}}" name="textbox" ></textbox>
</form-group>
</form>
</td>
<td>
<form>
<form-group>
<textbox ngModel="{{reasoncode.Description}}" name="textbox1" ></textbox>
</form-group>
</form>
</td>
COMPONENT -
@Component({
selector: 'app-reason-codes',
templateUrl: './reason-codes.component.html',
styleUrls: ['./reason-codes.component.scss'],
providers: [ ReasonCodesActions],
encapsulation: ViewEncapsulation.None,
})
export class ReasonCodesComponent implements OnInit {
poolModel: ReasonCodeFormUIModel;
IReasonCodes: IReasonCodes[]=[];
i:any;
@select(store.isReasonCodeLoading) isLoading$: Observable<boolean>;
@select(store.displayReasonCodes) displayReasonCodes$:Observable<IReasonCodes>;
@select(store.isDisplayMessage) displayMessage$: Observable<boolean>;
@select(store.componentType) componentType$: Observable<number>;
Active:any;
addCodes:boolean;
state:any;
$event:any;
displayReasonCodes:any;
headers = [
{ label: 'REASON CODES ', sort: false },
{ label: 'DESCRIPTION', sort: false },
{ label: 'STATUS', sort :false}
];
constructor(private reasonCodesActions : ReasonCodesActions,
private uiActions:UIActions) {
}
ngOnInit (){
this.displayReasonCodes$.subscribe(data=>this.result=data);
this.reasonCodesActions.getReasonCodes();
}
Addrow(){
console.log("add");
this.isEditable=false;
this.reasonCodesActions.Addrow();
}
refresh(){
location.reload();
}