Getting started with TypeScript [Includes introduction to Angular ; write professional JavaScript code that scales, use interfaces and classes to build robust code, learn about generics, modules, arrow functions, decorators, declarations, npm and much mor
معرفی کتاب «Getting started with TypeScript [Includes introduction to Angular ; write professional JavaScript code that scales, use interfaces and classes to build robust code, learn about generics, modules, arrow functions, decorators, declarations, npm and much mor» نوشتهٔ Thomas Claudius Huber، منتشرشده توسط نشر Amazon Digital Services LLC در سال 2017. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
The adoption of TypeScript is increasing and as a serious developer you should have that language definitely in your pocket! Join Thomas in this book to learn the TypeScript language. After you set up your environment you get up to speed with basic types, interfaces, classes, functions, modules, decorators and you learn how to build modern, component-based web-applications with Angular and rock-solid TypeScript code. This book is structured into twelve chapters: 1. Introduction 2. Setting up Your Environment 3. Using TypeScript 4. Basic Types 5. Var, Let and Const 6. Interfaces and Classes 7. Generics 8. Functions 9. Modules 10. Decorators 11. Declaration Files 12. Angular with TypeScript Now lets learn TypeScript, so that you can build your next javascript-based application with this amazing, popular language. 1. Introduction. 10 10 Welcome! 10 10 Is this Book for You?. 10 10 About JavaScript and ECMA.. 11 10 JavaScript for Enterprise Apps. 12 11 The Power of TypeScript 13 11 Structure of this Book. 14 12 Getting the Samples. 15 12 Run the Samples. 16 12 Feedback. 16 13 About the Author. 17 13 2. Setting up Your Environment 20 15 Introduction. 20 15 Install Node.js and NPM... 20 15 Install TypeScript 21 15 Install Visual Studio Code. 22 16 Install Google Chrome. 23 16 Summary. 23 16 3. Using TypeScript 24 18 Introduction. 24 18 Run a Simple, Buggy JavaScript File. 24 18 Introduce TypeScript 27 19 Add and Use an Interface. 28 20 Fix the Code. 29 20 Define Compiler Options. 30 21 Create and Use a tsconfig.json-file. 32 22 Debug your TypeScript Code. 34 23 Hide JS in Visual Studio Code. 36 25 Summary. 38 25 4. Basic Types. 40 27 Introduction. 40 27 Boolean. 40 27 Type Inference. 41 27 Number. 42 28 String. 43 28 Arrays. 45 29 Iterating Arrays: for...of and for...in. 46 30 For... in on Objects. 47 30 Tuples. 48 30 Enums. 48 31 The any type. 50 31 Type Assertions. 52 32 Union Types. 54 33 Returning Void. 56 34 Never. 56 34 Undefined, null and Strict Null Checking. 57 35 Summary. 58 35 5. Var, Let and Const 60 37 Introduction. 60 37 Declare Variables. 60 37 Function-scoped vs. Block-scoped. 60 37 Multiple Declarations. 61 37 Declare Before Access. 62 38 Using Const 63 38 Summary. 63 38 6. Interfaces and Classes. 64 39 Introduction. 64 39 Interfaces. 64 39 Create and Instantiate a Class. 66 40 Implement an Interface. 69 41 Type Compatibility in TypeScript 69 41 Access Modifiers of Class Members. 70 41 Parameter Properties. 71 42 Readonly Properties. 72 43 Properties with Accessors. 74 43 Static Properties. 75 44 Inheritance. 76 44 Abstract Classes. 77 45 Constructor Parameters. 78 45 The instanceof Operator. 79 46 Destructuring Objects. 80 46 Summary. 82 47 7. Generics. 85 49 Introduction. 85 49 The Generic Array Type. 85 49 Generic Functions. 86 49 Generic Interfaces. 87 49 Generic Classes. 88 50 Generic Constraints. 89 51 Multiple Type Parameters. 91 51 Summary. 92 52 8. Functions. 93 53 Introduction. 93 53 Types of Functions in JavaScript 93 53 Adding Types to Functions. 94 53 Optional Parameters. 94 53 Default Values. 95 54 Rest Parameters. 96 54 Functions as parameters. 97 54 Interfaces for Functions. 98 55 Functions and This. 99 55 Arrow Functions. 101 56 Async and Await 103 57 Summary. 105 58 9. Modules. 107 59 Introduction. 107 59 Module Basics. 107 59 Export and Import 108 59 Setting Up a Module Loader. 109 60 How to Install Dependencies for a Project 117 63 Export Multiple Types. 117 63 Import Multiple Types. 118 64 Use Export Aliases. 119 64 Use Import Aliases. 120 64 Default Export 120 65 Exporting Variables and Functions. 121 65 Summary. 123 66 10. Decorators. 125 67 Introduction. 125 67 Decorator Basics. 125 67 Turn on Decorator Support 126 67 Create a Property Decorator. 127 68 Create a Class Decorator. 129 69 Use the Reflect-metadata Library. 131 70 Component Decorator in Angular. 133 71 Summary. 134 71 11. Declaration Files. 135 72 Introduction. 135 72 Include a Simple JavaScript-library. 135 72 Declare a Function. 137 73 Install Declaration Files from NPM... 137 73 Write Your Own Library with Declarations. 139 74 Summary. 141 75 12. Angular with TypeScript 143 76 Introduction. 143 76 Run the Angular Book Samples. 143 76 Hello World in Angular. 145 77 Directives in Angular. 150 79 Create Lists with ngFor. 150 79 Display Details with ngIf 154 81 Data Binding in Angular. 155 82 Add a Two-Way Data Binding. 156 82 Create a Friend Component 157 83 Connect to GitHub via Http. 161 85 Extract Http-logic into a Service. 167 88 Summary. 170 90 "TypeScript is a JavaScript-superset that supports static typing and compiles down to plain JavaScript. TypeScript gives you compile-time errors, great tooling support and the latest JavaScript features like classes, arrow functions and modules that you can compile down to a JavaScript version that is supported in today's browsers. Typescript is open source and maintained by Microsoft and C# inventor Anders Hejlsberg. Google has written its popular Single Page Application Framework Angular with TypeScript. Join Thomas in this book to learn the TypeScript-language. Set up your environment and get up to speed with basic types, interfaces, classes, functions, modules, decorators and learn how to build web-apps with Angular and TypeScript."--Back cover
دانلود کتاب Getting started with TypeScript [Includes introduction to Angular ; write professional JavaScript code that scales, use interfaces and classes to build robust code, learn about generics, modules, arrow functions, decorators, declarations, npm and much mor