My HTML looks something like this:
<input type="number" class="form-control" id="khatianNumber" required [(ngModel)]="big.khatianNumberP1" name="khatianNumber" #khatianNumber="ngModel">
<p id="parapart" align="center">/</p>
<input type="number" class="form-control" id="khatianNumber2" required [(ngModel)]="big.khatianNumberP2" name="khatianNumber2" #khatianNumber1="ngModel">
And my Angular looks something like this,
export class RegistrationComponent implements OnInit,OnChanges {
isRequesting = false;
steps = [];
model = {
khatianNumber: '',
};
big = {
khatianNumberP1: '',
khatianNumberP2: '',
}
ngOnChanges(changes: SimpleChanges){
if (changes['big.plotNumberP1']){
alert("hi");
}
}
}
I've never used angular like this, I usually had to use scopes and controllers.
Can someone tell me what am I doing wrong? Is there something wrong with my HTML or am I using the models wrong? I am new to Angular and would greatly appreciate if someone could clear this doubt!