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 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>"
      }
  }
}

 
 
 
.webp) 
0 تعليقات
POST Answer of Questions and ASK to Doubt