Browser console return "My function is not defined"

So, i’m starting to learn the Ionic, so i can create an app that grabs information from an API and then returns the values. But let’s start from this minor problem. I’m trying to create some code that reads an input, then the code try to check if this number belongs into the others(like an id), and then returns if it’s real or not, but it seems i’m not doing it right.

I’m not understanding anything about angular, so i just made the same thing i would on javascript and try it, but it didn’t work.

HTML code:

<ion-header>
  <ion-toolbar>
    <ion-title>
      Tab One
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <form type="post">
  <div id="logout"></div>
  <div id="datalogin">
   login:<br> 
  <ion-input type="number" id="alunoid"></ion-input>
  <ion-button onclick="login();">enter</ion-button>
  <div id="mensagem"></div>
</div>
</form>
</ion-content>

.TS code:

import { Component } from '@angular/core';

@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss']
})
export class Tab1Page {
 public alunoid = document.getElementById("alunoid");
  private i;
  private h;
  private mensagem;
  constructor() {}
  
  login()
  {
    this.i=0;
    this.h=20;
    this.mensagem = "";
    
      for(this.i=0;this.i >= this.h; this.i++)
      {
        if(this.alunoid =this.h[this.i])
        {
          this.mensagem = "login concluído";
          break;
        }
        else
        {
          this.mensagem="usuário não existente";
        }
        
      }
      document.getElementById("mensagem").innerHTML= this.mensagem;
     
  }
}

I would suggest taking the time to go through the Tour of Heroes if you do want to be using Angular. There isn’t really any point in addressing the code that you do have unless you are planning on going frameworkless, in which case somebody else will have to help out, because I use Angular and TypeScript specifically to keep me from having to deal with the frustration and tedium of JavaScript and manual DOM interaction.