0% found this document useful (0 votes)
22 views24 pages

Upc Pre Si705 Web Frontend Apps Foundation - v2

This document discusses TypeScript and Angular. TypeScript allows for static typing of variables and classes. Classes can define properties and methods, and instances of classes can be created. Access modifiers like private can restrict access to properties and methods.

Uploaded by

Luis Jesus Rc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views24 pages

Upc Pre Si705 Web Frontend Apps Foundation - v2

This document discusses TypeScript and Angular. TypeScript allows for static typing of variables and classes. Classes can define properties and methods, and instances of classes can be created. Access modifiers like private can restrict access to properties and methods.

Uploaded by

Luis Jesus Rc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

TYPESCRIPT

WEB FRAMEWORKS
ANGULAR
$ node -v

$ npm install -g typescript

$ tsc -v
let name: string; // for strings
let age: number; // for any kind of numbers
let isChecked: boolean; // true or false
let data: any; // can be changed later to any type
let array: number[]; // array of numbers
class Student {
firstName: string;
lastName: string;
studentId: number;

getGrades() {
// some code
}
}

let student = new Student(); // an instance of Student class


class Student {
firstName: string;
lastName: string;

constructor(firstName?: string, lastName?: string) {


this.firstName = firstName;
this.lastName = lastName;
}
getGrades() {
// some code
}
}
class Student {
private firstName: string;
private lastName: string;
constructor(firstName?: string, lastName?: string) {
this.firstName = firstName;
this.lastName = lastName;
}
getGrades() {
// some code
}
}
TYPESCRIPT
WEB FRAMEWORKS
ANGULAR
TYPESCRIPT
WEB FRAMEWORKS
ANGULAR

You might also like