Answers for "angular typescript example"

0

sample typescript code

for (let i: number = 0; i < 5; ++i) {
  let line: string = "";
  for(let j: number = 0; j <= i; ++j) {
    line += "*";
  }
  console.log(line);
}
/*Simple for loop that gives this output:
*
**
***
****
*****
*/
Posted by: Guest on September-28-2021
0

basic of angular typescript

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

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {
  title = 'first';
  //function in class:
  getname() {
    return this.title;
  }
  //object:
  obj = {
    fname: 'hey',
    lname: 'there!',
  };
  //array:
  arr = ['php', 'java', '.net'];
  a=12;
  b=4;
  Url=window.location.href
}
Posted by: Guest on March-02-2022

Code answers related to "angular typescript example"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language