Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

TypeScript 101

TypeScript 101. TypeScript is a tool that allows you to utilize object oriented programming techniques with your JavaScript code. With TypeScript you have the same sort of namespaces and classes that you use to build your business objects. TypeScript classes support both inheritance and interfaces. We’ll introduce you to these concepts and show you how to use TypeScript to manage and organize your JavaScript code.

  • Login to see the comments

TypeScript 101

  1. 1. TypeScript 101Ross Termanwww.xeq.comrterman@xeq.comted by Ross Terman
  2. 2. What is TypeScriptTypeScript is a superset of JavaScriptYou can enter pure JavaScript into TypeScriptTypeScript gives you type safety.TypeScript gives you encapsulation.TypeScript allows you to organize your code into Modules and Classes
  3. 3. Get TypeScriptwww.TypeScriptLang.org Essentials
  4. 4. TypeScript Features• Standard JavaScript Code• Static Typing• Encapsulation with Modules and Classes• Classes support Constructors, Properties, Fields and Functions• Interfaces• Lambda Functions =>• Intellisense and syntax checking
  5. 5. Additional Keywords and Operators exports and importsconstructorextendsimplementsInterfacepublic/private… Rest syntax=> Arrow or lambda functions<typename> type conversion: assignment
  6. 6. Code Hierarchy Module Interface Class Fields Constructors Properties Functions
  7. 7. TypesType InferenceAnnotationsType Definition FilesPrimitive Types: Number, String, Boolean, Any, Null, UndefinedObject Types
  8. 8. FunctionsParameters – Required and OptionalArrow (lambda) functionsVoid for functions that return no value
  9. 9. ClassesClass Members – Fields, Properties, Functions, ConstructorsAdd functions to a class. Note lack of function keywordDefine propertiesComplex Types (object types) – Instantiate with New keywordTypes can be cast Types – super() function. Similar to baseImmediately-invoked function expression – iffy
  10. 10. InterfacesOptional membersImplementingUsing an Interface as a typeExtend interface
  11. 11. ModulesBenefits – Separation of concern, maintainable, testable, reusableOpen – Can be exposed for both Import and ExportAsynchronous Module Definition - AMD
  12. 12. Resourceshttp://www/typescriptlang.org
  13. 13. Contact UsRoss Terman –