Book Image

Angular 2 Cookbook

By : Patrick Gillespie, Matthew Frisbie
Book Image

Angular 2 Cookbook

By: Patrick Gillespie, Matthew Frisbie

Overview of this book

Angular 2 introduces an entirely new way to build applications. It wholly embraces all the newest concepts that are built into the next generation of browsers, and it cuts away all the fat and bloat from Angular 1. This book plunges directly into the heart of all the most important Angular 2 concepts for you to conquer. In addition to covering all the Angular 2 fundamentals, such as components, forms, and services, it demonstrates how the framework embraces a range of new web technologies such as ES6 and TypeScript syntax, Promises, Observables, and Web Workers, among many others. This book covers all the most complicated Angular concepts and at the same time introduces the best practices with which to wield these powerful tools. It also covers in detail all the concepts you'll need to get you building applications faster. Oft-neglected topics such as testing and performance optimization are widely covered as well. A developer that reads through all the content in this book will have a broad and deep understanding of all the major topics in the Angular 2 universe.
Table of Contents (18 chapters)
Angular 2 Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface

Introduction


In Angular 1, promises acted as strange birds. They were essential for building robust asynchronous applications, but using them seemed to come at a price. Their implementation by way of the $q service and the duality of promise and deferred objects seemed bizarre. Nonetheless, once you were able to master them, it was easy to see how they could be the foundation of extremely robust implementations in the single-threaded event-driven world of JavaScript.

Fortunately, for developers everywhere, ES6 formally embraces the Promise feature as a central component. Since TypeScript is a superset of ES6, you will be pleased to know that you can wield promises everywhere in Angular without extra baggage. Although Observables subsume a lot of the utility offered by promises, there is still very much a place for them in your toolkit.

Tip

Being able to use Promises natively is a privilege of TypeScript to a JavaScript transpilation. As of now, some browsers support Promises natively, while...