when i click the checkbox the row is converted to textbox
then when i tried to change the data then uncheck the checkbox the value changed
what i want is to return the original value when i uncheck the checkbox

<table
        class="table table-borderless text-custom-fs-16px border-b border-custom-gray2"
      >
        <thead class="bg-custom-orange">
          <tr>
            <th class="text-white w-custom-5% rounded-none text-center">
              <input
                type="checkbox"
                [(ngModel)]="selectAll"
                (change)="toggleSelectAll()"
              />
            </th>
            <th class="text-white w-custom-5% rounded-none text-center">No.</th>
            <th class="text-white w-custom-10% rounded-none text-center">
              Code
            </th>
            <th class="text-white w-custom-25% rounded-none text-center">
              Name
            </th>
            <th class="text-white w-custom-25% rounded-none text-center">
              Description
            </th>
            <th class="text-white w-custom-10% rounded-none text-center">
              Actions
            </th>
          </tr>
        </thead>
        <tbody>
          <ng-container
            *ngFor="
              let country of filteredCountries;
              let counter = index;
              let isOdd = odd
            "
          >
            <tr
              *ngIf="!isInputRowVisible|| !country.selected"
              [class.even:bg-custom-white-bg]="isOdd"
              [class.odd:bg-white]="!isOdd"
              class="border-t border-b"
            >
              <td class="w-custom-5% rounded-none text-center">
                <input
                  type="checkbox"
                  [(ngModel)]="country.selected"
                  (change)="anySelected()"
                />
              </td>
              <td class="w-custom-5% rounded-none text-center">
                {{ counter + 1 }}
              </td>
              <td class="w-custom-10% rounded-none text-center">
                <ng-container *ngIf="country.selected">
                  <input type="text" [(ngModel)]="country.code" maxlength="10" required/>
                </ng-container>
                <ng-container *ngIf="!country.selected">
                  {{ country.code }}
                </ng-container>
              </td>
              <td class="w-custom-25% rounded-none text-center">
                <ng-container *ngIf="country.selected">
                  <input type="text" [(ngModel)]="country.name" maxlength="100" required/>
                </ng-container>
                <ng-container *ngIf="!country.selected">
                  {{ country.name }}
                </ng-container>
              </td>
              <td class="w-custom-25% rounded-none text-center">
                <ng-container *ngIf="country.selected">
                  <input type="text" [(ngModel)]="country.description" maxlength="180" required/>
                </ng-container>
                <ng-container *ngIf="!country.selected">
                  {{ country.description }}
                </ng-container>
              </td>
              <td class="w-custom-10% rounded-none text-center">
                <button
                  (click)="openModal(2, country)"
                  type="button"
                  class="bg-custom-gray text-custom-blue border-none w-custom-w-60px h-custom-h-30px mr-1 hover:bg-custom-gray focus:bg-custom-gray rounded"
                >
                  <i class="material-icons align-top">edit</i>
                </button>
                <button
                  (click)="openConfirmationDialogBox(3, country)"
                  type="button"
                  class="bg-custom-red-del text-custom-white border-none w-custom-w-60px h-custom-h-30px hover:bg-custom-red-del focus:bg-custom-red-del rounded"
                >
                  <i class="material-icons align-top">delete_forever</i>
                </button>
              </td>
            </tr>
            <tr *ngIf="isObjectEmpty(countries)">
              <td colspan="6" class="text-center">{{ EMPTY_LIST }}</td>
            </tr>
          </ng-container>
        </tbody>
      </table>

what i want is to return the original value when i uncheck the box
so lets say i check the box then put in textbox then i cancel using unchecking it