问题
If i use like this form i am getting error in angular8.How to resolve this issue.why i am getting like this issue?Where i want to update in my code.If anyone knows please help me.
Error:
check.html:3 ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ng-untouched: true'. Current value: 'ng-untouched: false'.
at viewDebugError (core.js:28793)
at expressionChangedAfterItHasBeenCheckedError (core.js:28770)
at checkBindingNoChanges (core.js:29758)
at checkNoChangesNodeInline (core.js:44443)
at checkNoChangesNode (core.js:44416)
at debugCheckNoChangesNode (core.js:45377)
at debugCheckRenderNodeFn (core.js:45309)
at Object.eval [as updateRenderer] (check.html:3)
at Object.debugUpdateRenderer [as updateRenderer] (core.js:45294)
at checkNoChangesView (core.js:44251)
app.component.html:
<form name="adds">
<div class="row">
<div class="col-md-4">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="inlineRadio1" name="inlineRadioOptions" [(ngModel)]="inlineRadioOptions" checked (change)="onItemChange($event)" value="same"/>
<label class="form-check-label" for="inlineRadio1">Same Address</label>
</div>
</div>
<div class="col-md-4">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="inlineRadio2" name="inlineRadioOptions" [(ngModel)]="inlineRadioOptions" (change)="onItemChange($event)" value="list"/>
<label class="form-check-label" for="inlineRadio2">Address List</label>
</div>
</div>
<div class="col-md-4">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="inlineRadio3" name="inlineRadioOptions" [(ngModel)]="inlineRadioOptions" (change)="onItemChange($event)" value="new"/>
<label class="form-check-label" for="inlineRadio3">New Address</label>
</div>
</div>
</div>
</form>
来源:https://stackoverflow.com/questions/63020136/angular8-radio-buttons-throws-expressionchangedafterithasbeencheckederror