Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Web technology and programming, Study notes of Web Programming and Technologies

Web programming, all you need to know is there in this pdf so enjoy it

Typology: Study notes

2022/2023

Uploaded on 06/19/2023

math-36
math-36 🇮🇳

1 document

1 / 51

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Learning Angular
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33

Partial preview of the text

Download Web technology and programming and more Study notes Web Programming and Technologies in PDF only on Docsity!

Learning Angular

  • (^) Angular is built on TypeScript, so it is important that you have an understanding of it in order to use Angular.
  • (^) Learning the Different Types Like JavaScript, TypeScript uses data types to handle data, but there are some differences in syntax.
  • (^) TypeScript also adds in an extra type enumeration.
  • (^) var myString: string = 'Some Text'; var anotherString: string = "Some More Text";

Number

  • (^) This data type stores data as a numeric value.
  • (^) Var myInteger: number = 1;
  • (^) var cost: number = 1.33;

Array

  • (^) An indexed array is a series of separate distinct data items, all stored under a single variable name.
  • (^) var arr:string[] = ["one", "two", "three"];
  • (^) var firstInArr = arr[0];
  • (^) var arr2:Array = ["a", "second", "array"];
  • (^) var firstInArr2 = arr[0];

Null

  • (^) Sometimes you do not have a value to store in a variable either because it hasn’t been created or you are no longer using it.
  • (^) var newVar = null;

Void

  • (^) You use void when you don’t want a variable to have any type at all.

Enum

  • (^) TypeScript lets us use enum, which allows you to give names to enumerated values
  • (^) Enum People {Bob, John, Alex}
  • (^) var x = People.Bob
  • (^) var y = People[0]
  • (^) interface Person { hairColor: string; age: number; }

interface AddNums { (num1: number, num2: number) } var x: number = 5; var y: number = 10; var newNum: AddNums; newNum = function(num1: number, num2: number) { var result: number = num1 + num2; document.write(result) return result; } var z = newNum(x, y);

class Person { name: string; age: number; hungry: boolean = true; constructor(name: string, age?: number) { this.name = name; this.age = age; } feed() { this.hungry = false; return "Yummy!"; } } var Brendan = new Person("Brendan", 21);

  • (^) Class Inheritance Classes are subject to inheritance, and you can pass functionality to other classes by using methods and attributes
  • (^) module Person { export interface PersonInterface { name: string; hungry: boolean; feed(); } }
  • (^) The submodule starts by using /// to point to the root module so it can have access to the PersonInterface interface.