Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Angular 6 for Enterprise-Ready Web Applications
Angular 6 for Enterprise-Ready Web Applications

Angular 6 for Enterprise-Ready Web Applications: Deliver production-ready and cloud-scale Angular web apps

eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Angular 6 for Enterprise-Ready Web Applications

Create a Local Weather Web Application

In this chapter, we will be designing and building a simple Local Weather app with Angular and a third-party web API, using an iterative development methodology. You will focus on delivering value first, while learning about the nuances and optimal ways of using Angular, TypeScript, Visual Studio Code, Reactive Programming, and RxJS. Before we dive into coding, we will go over the philosophy behind Angular and ensure that your development environment is optimized and can enable collaboration and effortless information radiation.

Each section of this chapter will introduce you to new concepts, best practices, and optimal ways of leveraging these technologies and cover the bases to close any knowledge gaps you may have about web and modern JavaScript development basics.

In this chapter, you will learn Angular fundamentals to build a simple...

Introduction to Angular

Angular is an open source project maintained by Google and a community of developers. The new Angular platform is vastly different from the legacy framework you may have used in the past. A collaboration with Microsoft makes TypeScript, which is a superset of JavaScript, the default development language, enabling developers to target legacy browsers such as Internet Explorer 11, while writing modern JavaScript code that is supported in evergreen browsers such as Chrome, Firefox, and Edge. The legacy versions of Angular, versions in the 1.x.x range, are now referred to as AngularJS. Version 2.0.0 and higher versions are simply called Angular. Where AngularJS is a monolithic JavaScript Single Page Application (SPA) framework, Angular is a platform that is capable of targeting browsers, hybrid-mobile frameworks, desktop applications, and server-side rendered...

What's new in Angular 6?

Most, if not all, of the content, patterns, and practices in this book are compatible with Angular 4 and up. Angular 6 is the latest version of Angular, which brings a lot of under-the-cover improvements to the platform and overall stability and cohesion across the ecosystem. The development experience is being vastly improved with additional CLI tools that make it easier to update versions of packages and faster build times to improve your code-build-view feedback cycle. With Angular 6, all platform tools are version synced to 6.0, making it easier to reason about the ecosystem. In the following chart, you can see how this makes it easier to communicate tooling compatibility:

Previously With v6
CLI 1.7 6.0
Angular 5.2.10 6.0
Material 5.2.4 6.0

Angular CLI 6.0 comes with major new capabilities, such as ng update and ng add commands; ng...

Angular in Full-Stack Architecture

In this chapter, we will design, architect, create a backlog, and establish the folder structure for your Angular project that will be able communicate with a REST API. This app will be designed to demonstrate the uses of the following:

  • Angular CLI tool (ng)
  • Angular Reuse of UI through components
  • Angular HttpClient
  • Angular Router
  • Angular Reactive Forms
  • Material Autocomplete
  • Material Toolbar
  • Material Sidenav

Regardless of your backend technology, I recommend that your frontend always resides in its own repository and is served using its own web server that is not depended on your API server.

First things first, you need a vision and a road map to act upon.

Wireframe design

There are some...

Generate your Angular application

The Angular CLI (Angular CLI) is an official Angular project to ensure that newly created Angular applications have a uniform architecture, following the best practices perfected by the community over time. This means that any Angular application you encounter going forward should have the same general shape. Angular CLI goes beyond initial code generation. You will be using it frequently to create new components, directives, pipes, services, modules, and more. Angular CLI will also help you during development with live-reloading features so that you can quickly see the results of your changes. Angular CLI can also test, lint, and build optimized versions of your code for a production release. Furthermore, as new Angular versions are released, Angular CLI will help you upgrade your code, by automatically rewriting portions of it so that it remains...

Optimizing VS Code for Angular

Saving files all the time can get tedious. You can enable automatic saving by doing the following:

  1. Open VS Code
  2. Toggle the setting under File | Auto Save

You can further customize many aspects of VS Code's behavior by launching Preferences. The keyboard shortcut to launch Preferences is Ctrl + , on Windows and ⌘ + , on macOS.

IDE settings

You can share such settings with your coworkers by creating a .vscode folder in the root of your project directory and placing a settings.json file in it. If you commit this file to the repository, everyone will share the same IDE experience. Unfortunately, individuals aren't able to override these settings with their own local preferences...

Planning a feature road map using Waffle

Building a rough plan of action before you start coding is a very important so that you and your colleagues or clients are aware of the road map you're planning to execute. Whether you're building an app for yourself or for someone else, a living backlog of features will always serve as a great reminder when you get back to a project after a break or serve as an information radiator that prevent constant requests for status updates.

In Agile development, you may have used various ticketing systems or tools that surface or Kanban boards. My favorite tool is Waffle.io, https://waffle.io/, because it directly integrates with your GitHub repository's issues and keeps track of status of issues via labels. This way, you can keep using the tool of your choice to interact with your repository and still, effortlessly, radiate information...

Crafting UI elements using components and interfaces

You will be leveraging Angular components, interfaces, and services to build the current weather feature in a decoupled, cohesive, and encapsulated manner.

The landing page of an Angular app, by default, resides in app.component.html. So, start by editing the template of AppComponent with rudimentary HTML, laying out the initial landing experience for the application.

We are now beginning the development of Feature 1: Display Current Location weather information for the current day, so, you can move the card in Waffle to the In Progress column.

We will add a header as an h1 tag, followed by the tagline of our app as a div and placeholders for where we may want to display the current weather, as demonstrated as shown in the following code block:

src/app/app.component.html
<div style="text-align:center">
&lt...

Using Angular Services and HttpClient to retrieve data

Now you need to connect your CurrentWeather component to the OpenWeatherMap APIs. In the upcoming sections, we will go over the following steps to accomplish this goal:

  1. Create a new Angular Service
  2. Import HttpClientModule and inject it into the service
  3. Discover the OpenWeatherMap API

  1. Create a new interface that conforms to the shape of the API
  2. Write a get request
  3. Inject the new service into the CurrentWeather component
  4. Call the service from the init function of the CurrentWeather component
  5. Finally, map the API data to the local ICurrentWeather type using RxJS functions so that it can be consumed by your component

Creating a new Angular Service

Any code that touches...

Transform data using RxJS

RxJS stands for Reactive Extensions, which is a modular library that enables reactive programming, which itself is an asynchronous programming paradigm and allows for manipulation of data streams through transformation, filtering, and control functions. You can think of reactive programming as an evolution of event-based programming.

Understanding Reactive programming

In Event-Driven programming, you would define an event handler and attach it to an event source. In more concrete terms, if you had a save button, which exposes an onClick event, you would implement a confirmSave function, which when triggered, would show a popup to ask the user Are you sure?. Look at the following figure for a visualization...

Summary

Congratulations, in this chapter, you created your first Angular application with a flexible architecture while avoiding over-engineering. This was possible because we first built a road map and codified it in a Kanban board that is visible to your peers and colleagues. We stayed focused on implementing the first feature we put in progress and didn't deviate from the plan.

You can now use Angular CLI and an optimized VS Code development environment to help you reduce the amount of coding you need to do. You can leverage TypeScript anonymous types and observable streams to accurately reshape complicated API data into a simple format without having to create one-use interfaces.

You learned to avoid coding mistakes by proactively declaring input and return types of functions and working with generic functions. You used the date and decimal pipes to ensure that the data...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore tools and techniques to push your web app to the next level
  • Master Angular app design and architectural considerations
  • Learn continuous integration and deploy your app on a highly available cloud infrastructure in AWS

Description

Angular 6 for Enterprise-Ready Web Applications follows a hands-on and minimalist approach demonstrating how to design and architect high quality apps. The first part of the book is about mastering the Angular platform using foundational technologies. You will use the Kanban method to focus on value delivery, communicate design ideas with mock-up tools and build great looking apps with Angular Material. You will become comfortable using CLI tools, understand reactive programming with RxJS, and deploy to the cloud using Docker. The second part of the book will introduce you to the router-first architecture, a seven-step approach to designing and developing mid-to-large line-of-business applications, along with popular recipes. You will learn how to design a solid authentication and authorization experience; explore unit testing, early integration with backend APIs using Swagger and continuous integration using CircleCI. In the concluding chapters, you will provision a highly available cloud infrastructure on AWS and then use Google Analytics to capture user behavior. By the end of this book, you will be familiar with the scope of web development using Angular, Swagger, and Docker, learning patterns and practices to be successful as an individual developer on the web or as a team in the Enterprise.

Who is this book for?

This book is for developers who want to confidently deliver high-quality and production-grade Angular apps from design to deployment. We assume that you have prior experience in writing a RESTful API with the tech stack of your choice; if you don't, you can still gain a lot of benefit from this book, which focuses on the entire scope of frontend development, from design to deployment!

What you will learn

  • Create full-stack web applications using Angular and RESTful APIs
  • Master Angular fundamentals, RxJS, CLI tools, unit testing, GitHub, and Docker
  • Design and architect responsive, secure and scalable apps to deploy on AWS
  • Adopt a minimalist, value-first approach to delivering your app with Kanban
  • Get introduced to automated testing with continuous integration on CircleCI
  • Optimize Nginx and Node.js web servers with load testing tools
Estimated delivery fee Deliver to Russia

Economy delivery 10 - 13 business days

$6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 31, 2018
Length: 512 pages
Edition : 1st
Language : English
ISBN-13 : 9781786462909
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to Russia

Economy delivery 10 - 13 business days

$6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : May 31, 2018
Length: 512 pages
Edition : 1st
Language : English
ISBN-13 : 9781786462909
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 147.97
Architecting Angular Applications with Redux, RxJS, and NgRx
$48.99
Mastering Angular Components
$43.99
Angular 6 for Enterprise-Ready Web Applications
$54.99
Total $ 147.97 Stars icon

Table of Contents

13 Chapters
Setting Up Your Development Environment Chevron down icon Chevron up icon
Create a Local Weather Web Application Chevron down icon Chevron up icon
Prepare Angular App for Production Release Chevron down icon Chevron up icon
Staying Up to Date with Angular Updates Chevron down icon Chevron up icon
Enhance Angular App with Angular Material Chevron down icon Chevron up icon
Reactive Forms and Component Interaction Chevron down icon Chevron up icon
Create a Router-First Line-of-Business App Chevron down icon Chevron up icon
Continuous Integration and API Design Chevron down icon Chevron up icon
Design Authentication and Authorization Chevron down icon Chevron up icon
Angular App Design and Recipes Chevron down icon Chevron up icon
Highly-Available Cloud Infrastructure on AWS Chevron down icon Chevron up icon
Google Analytics and Advanced Cloud Ops Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Most Recent
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8
(23 Ratings)
5 star 56.5%
4 star 8.7%
3 star 8.7%
2 star 13%
1 star 13%
Filter icon Filter
Most Recent

Filter reviews by




S. Horridge May 12, 2020
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
This is more like a recipe than a reference book.If you follow it from the start and work your way through, you will end up with an app, and learn a lot on the way.If you want t book you can dip into and learn how to do something, it is nearly useless because the examples all build on previous exercises.
Amazon Verified review Amazon
Felix Feb 02, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Probably, by now a reader of this review is thinking whether to buy new edition - Angular 8. My recommendation, *you should*. The good thing about this book is that it covers numerous aspects of Angular development. Of course, components, services and reactive; but also Angular Material, deployment, and analytics. Not too much that it would distract from the focus on developers - but enough to build a full-blown application. Personally, I would have a real authentication mechanism and server component instead of mock libraries - but maybe it would push books size too much.In response to some other comments. (1) I *love* the fact that the book incrementally builds large application, rather than have standalone "recipes". (2) *All* code books look terrible on mobile devices. This is no better and no worse. (3) I was following the book examples and didn't need to download the code until Chapter 10 (where it explicitly says, get the rest from github).Finally - a complaint to Amazon. It looks like I can only make comments to reviews that are made in US. Not sure if it is a way to deal with privacy legislation or simply a bug - but this is insane! You should fix it as soon as possible. Book readers across the globe should be able to share thoughts with each other!
Amazon Verified review Amazon
lill Sep 16, 2019
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Outdated links, a lot about testing, minimum of key concepts revealed.
Amazon Verified review Amazon
Andrej R. Jul 16, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Fantastic book for learning the Angular framework. I would say it is probably a better book for developers already familiar with MVC (e.g. Rails, Django, etc.) but it shouldn't discourage you from purchasing it if you are totally new to web development - you just may have to do some extra work on your own. I particularly liked that the author focused on building out line of business applications and really helps the reader cultivate the skills to go from an idea to a deployed production application. I hope there is an updated version covering Angular 8 soon!
Amazon Verified review Amazon
b. prin May 29, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I work in the DevOps speciality area and do not find myself very often developing backend or frontend code. However I find it important to understand how code is built and deployed for different applications. I found this book to be very helpful in learning the core concepts on angular, and as he works through building the application it gave me insight into how the developers would write the code. I would highly recommend this book to anybody looking to learn more about angular and the programming concepts associated with it.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela