I have some strange behavior by my ngModel-values within child-component. html-code:
<input type="text" pattern="^[a-zA-Z]$"
class="form-control" required="true"
id="myId"
[(ngModel)]="kName">
kName is an input field (@kName:string), which will be filled from parent-component. I can see that "this.kName" gets everytime new value from parent-component. But when I set after some actions on this field on:
this.kName = undefined;
And then I want to fill kName again from parent, my kName-current value will not appear on html-output, but I can see on: this.kName When I try to do like this:
<input type="text" pattern="^[a-zA-Z]$"
class="form-control" required="true"
id="myId"
[(ngModel)]="{{this.kName}}">
I get error on init
by html-pattern, because kName is undefined.
How can I refresh my ngModel-value?
Maybe I have some other problems...