Angular 19 Tutorial in Hindi #10 Define data Type in Angular

Why we need to define type

Define type for property

Define multiple type to property

Define Type for function params

Call function with params on button click

Interview Questions

let nameistring "Anil sidhu"

name:string "Anil Sidhu"

//var_hamerdata type-value


<h1>Define Data Type</h1>
<button (click)="sum(100,20)">Sum</button>


import { Component } from '@angular/core';
@Component({
selector: 'app-root',
imports: [],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent {
name:string = "Sidhu"
data:number | string=30;
userLogin:boolean=true
info:any="this is some data"
email="anc@test.com"

apple(){
this.data="abc"
this.info = 100

///
this.info =true

//

this.info=[]
}

sum(a:number,b:number){
let x : any=10
console.log(a+b);
}
}