-
TypeScript 2.x for Angular Developers-Packt Publishing(2017).epub下载
资源介绍
Chapter 1, From Loose Types to Strict Types, discusses the problems developers faced before TypeScript was introduced, and what problems TypeScript solves. We will do this by discussing loose types and their challenges, and show some examples of how these challenges were being tackled previously and why TypeScript is a better choice.
Chapter 2, Getting Started with Typescript, gives a summary of TypeScript's core concepts with practical examples on how to set up a vanilla JavaScript plus TypeScript project. All loosely typed examples in Chapter 1, From Loose Types to Strict Types, will be rewritten with TypeScript to demonstrate TypeScript's efficiency.
Chapter 3, Typescript Native Types and Features, takes a deep dive into built-in TypeScript strict types that match existing JavaScript loose types. Each type will be discussed extensively with working examples, showing how it should be used and how it should work.
Chapter 4, Up and Running with Angular and TypeScript, discusses how TypeScript applies to Angular. To do so, Angular needs to be up and running with the help of the CLI tool. In this chapter, we will discuss what it takes to have Angular and TypeScript work together. We will also cover the basic Angular concepts that you could find in a Hello World example.
Chapter 5, Advanced Custom Components with TypeScript, discusses the concept of web components and how Angular builds on web components with TypeScript. We will see how to create components with classes, implement lifecycle hooks with TypeScript interfaces, and define components, metadetails using TypeScript decorators.
Chapter 6, Component Composition with TypeScript, discusses how Angular is component-based. It explains that components are composed together as building blocks to make a fully functional app. We will discuss modularizing components using composition with examples and component interaction (data transfer and events). In doing so, we will see how TypeScript is used to keep us in check with all these moving parts.
Chapter 7, Separating Concerns with Typed Services, discusses how it’s bad practice to allow our logic to live in our components. In such a case, Angular allows you to provide API methods via services that these components can consume. We will discuss how TypeScript helps us create contracts (using types) between these API methods and the components.
Chapter 8, Better Forms and Event Handling with TypeScript, explains how the Angular form module enables us to write predictable typed forms with TypeScript, which is a perfect means of collecting data from our app users. We will also see how to use typed DOM events (for example, click, mouseover, and keydown) to respond to user interactions.
Chapter 9, Writing Modules, Directives, and Pipes with TypeScript, discusses the secondary building blocks of Angular and how they are best used with TypeScript. You will learn how to build custom directives and pipes in Angular with types and decorators.
Chapter 10, Client-Side Routing for SPA, explains Single Page Applications (SPAs), which are built by handing over routing to the client with JavaScript rather than the server. We will discuss how, with Angular and TypeScript, we can use the router module to build multiple view apps with just a single server route.
Chapter 11, Working with Real Hosted Data, takes a deep dive into consuming API data with Angular’s HTTP module. You will learn how to make an HTTP request right from our Angular app. Data fetched from this request can then be rendered by components.
Chapter 12, Testing and Debugging, covers recommended practices on unit testing Angular building blocks. These include components, services, routes, and more.