Search icon CANCEL
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
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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

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 a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

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
€18.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
€189.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
€264.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 111.97
Architecting Angular Applications with Redux, RxJS, and NgRx
€36.99
Mastering Angular Components
€32.99
Angular 6 for Enterprise-Ready Web Applications
€41.99
Total 111.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

Top Reviews
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
Top Reviews

Filter reviews by




Markzolotoy Apr 02, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book provides a complete example of an enterprise grade application. It explains different issues a real word application development usually encounters. Helped me a lot to get started learning Angular framework.
Amazon Verified review Amazon
Winslow VanDevanter Aug 08, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is unique in that it draws attention to many of the important aspects of building Angular apps so that they are cloud-ready and fit into an enterprise. Since it covers things like containerizing, testing with multiple test types, setting up auth, UX and architectural considerations, it helps highlight the swath of things needed to build something enterprise-grade. It also includes things that are often not in Angular books, like router architecture and continuous integration and delivery onto a real cloud provider (AWS).
Amazon Verified review Amazon
bjsawyer Jul 10, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a must-read for anyone looking to hit the ground running with Angular, whether you're tinkering around with passion projects or implementing Angular on a large-scale project. You will learn the basics of how to set up your local dev environment all the way up through deploying your application to a production server, with a whole lot more in between. There are plenty of tips along the way that will save you countless hours of trial & error, and the built-in hands-on exercise is a great way to apply the concepts discussed throughout the book.I have worked with Angular for a few years, however I managed to learn something new each time I opened up this book. Things are broken down in a way that are easy to follow and make seemingly complex tasks simple. I would recommend this to developers of all skill levels, whether brand new to Angular or a seasoned veteran.
Amazon Verified review Amazon
Plarzoid Oct 17, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The thing that sets this book apart from other Angular books is the comprehensive advice on how to take an idea from the back of a napkin to deployment.The book starts with a chapter on how to configure your development environment and integrate build tools and project management tools. Next, Doguhan provides thoughts on how to best work with the business stakeholders to gain a high-level concept of the application's major functions and turn that into a simple set of interactive wireframes. From there, you build a simple local weather app to cover the Angular basics.Switching gears into a well-defined line-of-business app project, you are shown how to build the walking skeleton of the new application utilizing the powerful Angular Router. This critical step gives you something to put in front of the stakeholders almost immediately. Not only is this very quick business value, but gives you an opportunity to iron out any large architecture-level issues before they become too difficult to manage.After the walking skeleton, several Angular concepts are covered in-depth as you work on features for the Lemon Mart app. This larger app provides an opportunity to talk about best practices, useful design patterns and potential pitfalls. The last chapters cover how to easily deploy the app to Amazon's cloud using Docker, and how to tie into Google Analytics to give your stakeholders feedback on site performance and user activity.So, yeah, you'll learn Angular.You'll also learn so much more that you can use on all of your future web-app efforts, regardless of whether or not you use Angular.
Amazon Verified review Amazon
Ken Russell May 24, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Coming from a background with some JavaScript knowledge but no prior Angular experience, this was very easy to follow. Often used it as a reference when building Angular projects at work or on my own time. Would recommend! 💯
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 included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.