Seiji Villafranca
github.com/SeijiV13
Senior Software Engineer, SmartBite Malaysia
Auth0 Ambassador
Community Lead, AngularPH,
seijivillafranca.com
Goals for Workshop
Let's discuss
programming language which was developed by Microsoft. It is free, open source and superset of the JavaScript
October 2012
Anders Hejlsberg,
the lead architect of c#,
version 0.8
Absence of IDE support
Eclipse (plugin by Palantir)
Text Editor (Sublime etc.)
Tyepscript 0.9 supports Generics
Tyepscript 1.0
2013
2014
Prototypes
Dynamic Types
Generics
Interfaces
Types
class Student {
fullName: string;
constructor(public firstName: string, public middleInitial: string,
public lastName: string) {
this.fullName = firstName + " " + middleInitial + " " + lastName;
}
}
interface Person {
firstName: string;
lastName: string;
}
let user = new Student("Jane", "A", "Doe");Transpiler
Target: ES6/ES5
Browsers don't understand Typescript
Some Features
Types
Any
Built-in types
User Defined Types
number, string, boolean, void, null, undefined
Arrays, Enums, Classes, Interfaces
Some Features
Union Types
ability to combine one or two types
var val:string|number
val = 12
val = "This is a string"
Some Features
Interfaces
interface IPerson {
firstName:string,
lastName:string,
sayHi: ()=>string
}
var employee:IPerson = {
firstName:"Jim",
lastName:"Blakes",
sayHi: ():string =>{return "Hello!!!"}
}
using Iperson Interface
Some Features
Classes
class Car {
//field
engine:string;
//constructor
constructor(engine:string) {
this.engine = engine
}
//function
disp():void {
console.log("Engine is : "+this.engine)
}
}
Some Features
Objects
var object_name = {
key1: “value1”,
key2: “value”,
key3: function() {
//functions
},
key4:[“content1”, “content2”]
};
https://www.typescriptlang.org/community
Angular
Front End Framework
Single Page Application
Typescript Based
Component Based
Angular
Module
Component
Service
Collection of Components, Services, Directives, and also Modules
Can be imported into multiple Modules
A piece of code that defines the view with custom behaviors
Cannot be imported into multiple modules
Lets think of this one as a customized HTML Element with customized attributes
Used to communicate with endpoints
Used by components by dependency injection
Can also be injected by services
Building blocks
Side Menu
Can be seen on most of all pages
Can be a component that can be reused in different pages
Boilerplate code reduction
npm install –g @angular/cli
https://nodejs.org/en/
Check npm verision
Check npm verision
npm -v
ng --version
Install Angular CLI
Install Node JS
Back End Node Framework
Typescript Based
Shares many concepts with Angular that's why its called the perfect match
npm install –g @nest/cli
https://nodejs.org/en/
Check npm verision
Check npm verision
npm -v
nest --version
Install Nest CLI
Install Node JS
https://docs.nestjs.com/
https://www.seijivillafranca.com/post/integrating-jwt-with-nest-js-and-mongo
https://angular.io/
https://www.seijivillafranca.com/blog
github.com/SeijiV13
seijivillafranca.com
fb.com/seiji.villafranca
https://www.facebook.com/groups/1133816916630570
https://www.facebook.com/Angular-PH-113942453649977
Group
Facebook Page