Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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
}
Source by angular.io #
 
PREVIOUS NEXT
Tagged: #basic #angular #typescript
ADD COMMENT
Topic
Name
1+4 =