title: How to print the alphabet in TypeScript?
body: <p>We are trying to design a health care app using Angular. For data filtering we are creating a bar which looks like this below image:</p>
  
  <p><a href="https://i.stack.imgur.com/VwiSo.jpg" rel="nofollow noreferrer">Data Filterbar image</a></p>
  
  <p>To reduce the line of code we are writing the code in Typescript we are checking in the console whether its displaying  or not.</p>
  
  <p>We are not getting the expected output nor is it showing errors.</p>
  
  <p>Can anyone fix this issue?</p>
  
  <pre><code>listIndex(){
  while (this.i &lt;= 90) {
      this.alphabets.push(String.fromCharCode(this.i));
  }
  console.log(this.alphabets());}
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  </code></pre>
  
  <p>For your reference I'm posting the full TS file:</p>
  
  <pre><code>import {Component} from '@angular/core';
  import {HttpService} from '../../service/http.service';
  
  
  @Component({
      selector: 'patienthtml',
      templateUrl: 'app/component/patient/patient.html',
      providers: [HttpService]
  })
  
  export class PatientComponent{
  constructor( private httpService: HttpService ) {
  }
   //simple call init function on controller
  i=65;
  step = 0;
  
  patientData : any;
  alphabets: any = [];
  
  public ngOnInit(): any
  {
      this.getPatientData();
  }
   getPatientData(){
  
      this.httpService.getPatients("PatientData").subscribe(
      resp =&gt; {    
          if(resp!=null){
  
              this.patientData=resp.response;
          }
          console.log(this.patientData);
      },
      error =&gt; {
          console.log(error);
      }
      );   
  }
  listIndex(){
      console.log('ReachedHere');
      let alphabets = [];
      for (let i = 65; i &lt;= 90;i++) {
          alphabets.push(String.fromCharCode(this.i));
      }
      console.log(alphabets);
  
  }
  getCurrentStep() {
      return this.step;
  }
  goback(){
      this.step = this.step - 1;    }
  
  toReport(){
      this.step = this.step + 1;    }
  
  }
  </code></pre>