Reader small image

You're reading from  Getting Started with Angular - Second edition - Second Edition

Product typeBook
Published inFeb 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781787125278
Edition2nd Edition
Languages
Tools
Right arrow
Author (1)
Minko Gechev
Minko Gechev
author image
Minko Gechev

Minko Gechev is a software engineer who strongly believes in open source software. He has developed numerous such projects including codelyzer, the AngularJS style guide, aspect.js and many others, and is one of the coauthors of the official Angular style guide.
Read more about Minko Gechev

Right arrow

Preface

AngularJS is a JavaScript development framework that makes building web applications easier. It is used today in large-scale, high-traffic websites that struggle with performance and portability issues, as well as SEO unfriendliness and complexity at scale. The new version of Angular changes these.

It is the modern framework you need to build performant and robust web applications. Getting Started with Angular is the quickest way to get to grips with Angular; it will help you transition into the brave new world of Angular 2 and beyond.

By the end of the book, you'll be ready to start building quick and efficient Angular applications that take advantage of all the new features on offer.

What this book covers

Chapter 1, Get Going with Angular, kicks off our journey into the world of Angular. It describes the main reasons behind the design decisions of the framework. We will look at the two main drivers behind the shape of the framework—the current state of the Web and the evolution of frontend development.

Chapter 2, The Building Blocks of an Angular Application, gives us an overview of the core concepts introduced by Angular 2. We'll explore how the foundational building blocks for the development of applications provided by AngularJS differ from the ones in the last major version of the framework.

Chapter 3, TypeScript Crash Course, explains that although Angular is language agnostic, Google's recommendation is to take advantage of the static typing of TypeScript. In this chapter, you'll learn all the essential syntax you need to know to develop Angular applications in TypeScript.

Chapter 4, Getting Started with Angular Components and Directives, describes the core building blocks for developing the user interface of our applications—directives and components. We will dive into concepts such as view encapsulation, content projection, inputs and outputs, change detection strategies, and more. We'll discuss advanced topics, such as template references and speeding up our applications using immutable data.

Chapter 5, Dependency Injection in Angular, covers one of the most powerful features in the framework, which was initially introduced by AngularJS: its dependency injection mechanism. It allows us to write more maintainable, testable, and understandable code. By the end of this chapter, we will know how to define the business logic in services and glue them together with the UI through the DI mechanism. We will also look at some more advanced concepts, such as the injectors hierarchy, configuring providers, and more.

Chapter 6, Working with the Angular Router and Forms, explores the new module for managing forms in the process of developing a real-life application. We will also implement a page that shows the data entered through the form. In the end, we will glue the individual pages together into an application using the component-based router.

Chapter 7, Explaining Pipes and Communicating with RESTful Services, dives into the router and the forms modules in detail. Here, we will explore how we can develop model-driven forms and define parameterized and child routes. We will also explain the HTTP module and take a look at how we can develop pure and impure pipes.

Chapter 8, Tooling and Development Experience, explores some advanced topics in the Angular application development, such as Ahead-of-Time compilation, running an application in a Web Worker, and server-side rendering. In the second part of this chapter, we will explore tools that can ease our daily life as developers, such as angular-cli, angular-seed, and more.

What you need for this book

All you need to work through most of the examples in this book is a simple text editor or an IDE, Node.js, an already installed TypeScript, Internet access, and a browser.

Each chapter introduces the software requirements for running the provided snippets.

Who this book is for

Do you want to jump in at the deep end of Angular? Perhaps you're interested in assessing the changes before moving over? If so, then Getting Started with Angular is the book for you. To get the most out of the book, you'll need to be familiar with AngularJS and have a good understanding of JavaScript. No knowledge of the changes made to Angular 2 and later versions is required to follow along.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning. Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "You should see the same result, but without the test.js file stored on the disk." A block of code is set as follows:

@Injectable()
class Socket {
 constructor(private buffer: Buffer) {}
}

let injector = ReflectiveInjector.resolveAndCreate([
  provide(BUFFER_SIZE, { useValue: 42 }),
  Buffer,
  Socket
]);

injector.get(Socket);

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

let injector = ReflectiveInjector.resolveAndCreate([
  provide(BUFFER_SIZE, { useValue: 42 }),
  Buffer,
  Socket
]);

Each code snippet that is in the repository with the code from this book starts with a comment with its corresponding file location:

// ch5/ts/injector-basics/forward-ref.ts

@Injectable()
class Socket {
  constructor(private buffer: Buffer) {…}
}

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text surrounded by quotes, or like this: "When the markup is rendered onto the screen, all that the user will see is the label: Loading…."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us, as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail feedback@packtpub.com, and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from GitHub at https://github.com/mgechev/getting-started-with-angular. You can download the code files by following these steps:

  • Enter the URL in your browser's address bar

  • Click on the Download ZIP button located in the mid-right part of the screen

You can also download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can also download the code files by following these steps:

  • Log in or register to our website using your e-mail address and password.

  • Hover the mouse pointer on the SUPPORT tab at the top.

  • Click on Code Downloads & Errata.

  • Enter the name of the book in the Search box.

  • Select the book for which you're looking to download the code files.

  • Choose from the drop-down menu where you purchased this book from.

  • Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

Chapters 3 and 4 contain further information for the installation process.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at copyright@packtpub.com with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at questions@packtpub.com, and we will do our best to address the problem.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Getting Started with Angular - Second edition - Second Edition
Published in: Feb 2017Publisher: PacktISBN-13: 9781787125278
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Minko Gechev

Minko Gechev is a software engineer who strongly believes in open source software. He has developed numerous such projects including codelyzer, the AngularJS style guide, aspect.js and many others, and is one of the coauthors of the official Angular style guide.
Read more about Minko Gechev