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:

      Tab One

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

.TS code:

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

  selector: 'app-tab1',
  templateUrl: '',
  styleUrls: ['']
export class Tab1Page {
 public alunoid = document.getElementById("alunoid");
  private i;
  private h;
  private mensagem;
  constructor() {}
    this.mensagem = "";
      for(this.i=0;this.i >= this.h; this.i++)
        if(this.alunoid =this.h[this.i])
          this.mensagem = "login concluído";
          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.