Professional Documents
Culture Documents
Introduction
What is Angular ?:
Angular 6
2018 Mar
Angular 5
2017 Sept/Oct
Complete Rewrite
Angular 4
2017 Mar
Angular 2
2016 Sept
greet.ts
function greeter(person)
{
return "Hello, " + person;
}
let user = "Jane User";
document.body.innerHTML = greeter(user);
in CMD -> tsc greet.ts
Index.html
<!DOCTYPE html>
<html>
<head>
<title>TypeScript Greeter</title>
</head>
<body>
<script src="greeter.js"></script>
</body>
</html>
Types In Type Script BUILT-IN DATA TYPE KEYWORD DESCRIPTION
• In TypeScript, type assertion is a way to tell the compiler what is the type of a
variable.
• Type assertion is used when the type of the target variable might not be
known or the programmer knows better what is the actual type of it.
• Type assertion is like type casting in other languages, but in TypeScript it is
only a compile time feature.
Type assertion syntaxes
Angle-bracket syntax
let x: any = "Gadwal Bidda";
let s = (<string>x).substring(0,3);
console.log(s);
Output
Gad
Syntax:
1) Share data
2) Implement Application logic
3) External Interaction
Emp List
GET Request
Emp
HTTP
Service
Observable Response DB
Emp Details
Observables
Source DB