Help needs: Adding T&C checkbox to registration form is not working

Hello, I a complete newbie to Ionic and I’m trying to help a friend who has a working ionic-angular app. the point is that he need to include a mandatory checkbox in registration form to accept Terms and Conditions before register, as well as a link to download a pdf file with those T&C from website.

I got the project on mi computer and using VSCode I found register.component.html, register.component.scss and register.component.ts, which contains all related form and logic

In .html file I found a <form> tag with several fields needed to register a new user, like this one

<ion-item-group>
    <ion-item>
      <ion-label position="floating">Email</ion-label>
      <ion-input type="email" formControlName="email" required></ion-input>
    </ion-item>
    <ng-container *ngFor="let validation of email">
      <small class="error_message" *ngIf="
          form.get('email').hasError(validation.type) &&
          (form.get('email').dirty || form.get('email').touched)
        ">
        <ion-icon name="alert-outline"></ion-icon> {{ validation.message }}
      </small>
    </ng-container>
  </ion-item-group>

in .ts file I found a validation routine which is posted here:
https://codeshare.io/Wd96W8

Later, I’ve added in .html file a checkbox and a link as:

  <ion-item-group>
    <ion-item>
      <ion-checkbox slot="start" formControlName="tyc" required></ion-checkbox>
      <ion-label >He leído y acepto los <a href="https://domain.com/tyc/tycs-22.2.22.pdf" target="_blank" class="text-warning">términos y condiciones de uso</a> del sistema.</ion-label>
    </ion-item>
    <ng-container *ngFor="let validation of validations.tyc">
      <small class="error_message" *ngIf="
    form.get('tyc').hasError(validation.type) &&
    (form.get('tyc').dirty || form.get('tyc').touched)
  ">
        <ion-icon name="alert-outline"></ion-icon> {{ validation.message }}
      </small>
    </ng-container>
  </ion-item-group>

The project was created using Ionic5 + Angular 10 and I facing two different kind of problems:

  1. Running ng serve command as stated in package.json I get a preview of the app in localhost:4200, navigating to registration form is working and it shows the added checkbox and label as expected.

If I check the checkbox, registration form send its value to API, which is correct. But if I leave checkbox unchecked, it should fire an error because it is marked as required and added to validations array. But this validation doesn’t occur, and this is the first problem
(The same occurs when running ionic serve).

  1. When trying to compile the application, I found that the checkbox is not there anymore.

Screen Shot 2022-10-24 at 14.24.24

I’ve tried cleaning and removing www folder and then building again the project without success.

Any suggestion will be appreciated. Regards!