Search This Blog

Program Of Table in Angular Framework:-

Code of HTML

<p>factapp works!</p>

<input type="text" name="a" [(ngModel)]="a" />
<br><br>
<input type="button" name="btnclick" value="Click" (click)="factorial()">
<br>

<div [innerHTML]="s"></div>


Code of TS

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

@Component({
  selector: 'app-factapp',
  templateUrl: './factapp.component.html',
  styleUrls: ['./factapp.component.css']
})
export class FactappComponent implements OnInit {
  a
  f=1
  i=1
  s=''
  constructor() { 

     
  }

  ngOnInit() {
  }
  factorial()
  {
      this.f=1
      this.s=""
     for(this.i=1;this.i<=10;this.i++)
      {
         this.s=this.s+ this.a*this.i+"<br>"

      }
  }
}



Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post