Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

validation in angular using ngmodel

    <div *ngIf="gradeCategory.isEdit; else notMaxEdit">
                        <input
                          type="text"
                          id="{{ j }}"
                          [(ngModel)]="gradeCategory.maxGrade"
                          [value]="gradeCategory.maxGrade"
                          required="true"
                          #maxGrade="ngModel"
                        />
                        <span class="text-danger"
                        *ngIf="(maxGrade.touched ) && maxGrade.errors?.required">
                        Max Grade is required
                    </span>
                        <!-- (change)="calculateMaxGrade()" -->
                        <span *ngIf="gradeCategory.error">This is Required</span>
                      </div>
 
PREVIOUS NEXT
Tagged: #validation #angular #ngmodel
ADD COMMENT
Topic
Name
4+2 =