Book Image

Switching to Angular 2

By : Minko Gechev
Book Image

Switching to Angular 2

By: Minko Gechev

Overview of this book

<p>AngularJS is a JavaScript framework that makes building web applications easier. It is used today in large-scale, high-traffic websites that struggle with under-performance, portability issues, as well as SEO unfriendliness, and complexity at scale.</p> <p>Angular 2 changes that.</p> <p>It is the modern framework you need to build performant and robust web applications. “Switching to Angular 2” is the quickest way to get to grips with Angular 2 and will help you transition in to the brave new world of Angular 2.</p> <p>We’ll start with an overview which sets the changes of the framework in context with version 1.x. After that, you will be taken on a TypeScript crash-course so we can take advantage of Angular 2 in its native, statically-typed environment. We’ll look at the new change-detection method in detail, how Directives and Components change how you create websites with Angular, the new Angular 2 router, and much more.</p> <p>By the end of the book, you’ll be ready to start building quick and efficient Angular 2 applications that take advantage of all the new features on offer.</p>
Table of Contents (16 chapters)
Switching to Angular 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

TypeScript syntax and features introduced by ES2015 and ES2016


As TypeScript is a superset of JavaScript, before we start learning about its syntax, it's a little easier to start by introducing some of the bigger changes in ES2015 and ES2016; to understand TypeScript, we first must understand ES2015 and ES2016. We're going to have a whistle-stop tour through these changes before diving in to TypeScript proper later.

A detailed explanation of ES2015 and ES2016 is outside the scope of this book. In order to get familiar with all the new features and syntaxes, I strongly recommend you to take a look at Exploring ES6: upgrade to the next version of JavaScript by Dr. Axel Rauschmayer.

The next couple of pages will introduce new standards and allow you to take advantage of most of the features you're going to need in the development of Angular 2 applications.

ES2015 arrow functions

JavaScript has first class functions, which means that they can be passed around like any other value:

// ch3/arrow-functions...