Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AngularJS + Typescript === <3
Search
paul souche
January 29, 2015
Programming
360
0
Share
AngularJS + Typescript === <3
My presentation @ngparis on angular + typescript
paul souche
January 29, 2015
More Decks by paul souche
See All by paul souche
Une API from scratch avec NestJS
paulsouche
0
180
Unit test in deno
paulsouche
0
170
One spec to rule them all
paulsouche
1
310
Analytics reverse engineering
paulsouche
0
170
TypeScript + lerna + yarn monorepos FTW
paulsouche
1
1.9k
Test like a boss with TypeScript
paulsouche
0
240
The internal modules strike back
paulsouche
0
130
Ma caisse enregistreuse en NodeJS
paulsouche
0
580
Other Decks in Programming
See All in Programming
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
110
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.8k
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
190
AIと共に生きる技術選定 2026
sgash708
0
120
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
350
Road to RubyKaigi: Play Hard(ware)
makicamel
1
550
AI-DLC Deep Dive
yuukiyo
9
5.6k
10 Tips of AWS ~Gen AI on AWS~
licux
5
540
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
120
「OSSがあるなら自作するな」は AI時代も正しいか ── Build vs Adopt の新しい判断基準
kumorn5s
7
2k
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
220
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
310
Featured
See All Featured
Evolving SEO for Evolving Search Engines
ryanjones
0
190
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
370
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Deep Space Network (abreviated)
tonyrice
0
130
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
790
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Darren the Foodie - Storyboard
khoart
PRO
3
3.3k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
The Language of Interfaces
destraynor
162
26k
Transcript
AngularJS + Typescript === <3
Me Myself & I Paul Souche Développeur Front-end @ @paulsouche
https://github.com/paulsouche
JavaScript types... NaN === NaN //false 0.1 + 0.2 ===
0.3 //false '' == [] //true '' //false, [] true [] + [] --> '' {} + [] --> '[object Object]' [] + {} --> 0 {} + {} --> NaN ...
JavaScript types... 6 types “undefined” “boolean” “string” “number” “object” “function”
6 falsy type undefined “undefined” false “boolean” ‘’ “string” 0 “number” null “object” NaN “number”
in AngularJS You can use : • isDefined • isUndefined
• isString • isNumber • isObject • isDate • isArray • isElement • isFunction • isPrototypeOf and...
Classes types methods : • contructor • toString.call() • stackOverflow
Conclusion No strong typings in JavaScript and won’t be better
in ES6
OK Typescript
OK Typescript how do you work ? function greeter(person: string)
{ return "Hello, " + person; } var user = "Jane User"; var universalAnswer = 42; document.body.innerHTML = greeter(user); document.body.innerHTML = greeter(universalAnswer); //throw
OK Typescript how do I strong type ? interface Person
{ firstname: string; lastname: string; } function greeter(person : Person) { return "Hello, " + person.firstname + " " + person.lastname; } var user = {firstname: "Jane", lastname: "User"}; document.body.innerHTML = greeter(user);
OK Typescript what about es6 classes ? class Student {
fullname : string; constructor(public firstname, public middleinitial, public lastname) { this.fullname = firstname + " " + middleinitial + " " + lastname; } } interface Person { firstname: string; lastname: string; } function greeter(person : Person) { return "Hello, " + person.firstname + " " + person.lastname; } var user = new Student("Jane", "M.", "User"); document.body.innerHTML = greeter(user);
OK Typescript what about es6 modules ? module Validation {
export interface StringValidator { isAcceptable(s: string): boolean; } var lettersRegexp = /^[A-Za-z]+$/; var numberRegexp = /^[0-9]+$/; export class LettersOnlyValidator implements StringValidator { isAcceptable(s: string) { return lettersRegexp.test(s); } } export class ZipCodeValidator implements StringValidator { isAcceptable(s: string) { return s.length === 5 && numberRegexp.test(s); } } }
OK Typescript how do I get the compiler ? npm
install -g typescript
OK Typescript how do I watch my code ? lint
: https://github.com/palantir/tslint https://github.com/palantir/grunt-tslint https://github.com/panuhorsmalahti/gulp-tslint compile : https://github.com/k-maru/grunt-typescript https://github.com/ivogabe/gulp-typescript
OK Typescript and my dependencies ? DefinitelyTyped Interfaces : •
AngularJS • ng-route • ng-resource • ng-animate • ng-cookies • angular-ui-router & ui-bootstrap • Underscore / Lodash / Jquery ...
Un peu de code ?
OK Typescript what’s wrong with you ?
OK Typescript what’s wrong with you ?
Q & A Special thanks : ng-paris David Rousset @Davrous
L’équipe ADEO AngularJS 1.6.5 You