Book Image

AngularJS Deployment Essentials

By : Zachariah Moreno
Book Image

AngularJS Deployment Essentials

By: Zachariah Moreno

Overview of this book

Table of Contents (15 chapters)
AngularJS Deployment Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Where is AngularJS? Since AngularJS's inception, it has been deployed into a multitude of different environments, mostly due to its flexibility and extensibility. Parallel to Angular's rise are developer tools such as Apache Cordova and Chrome packaged apps. These have given developers the opportunity to deploy web applications on platforms that were previously dominated by languages such as Java and C. With these advancements, AngularJS apps can now be found in the Chrome Web Store, Google Play Store, Apple App Store, PlayStation Store, and Firefox Marketplace, all in addition to traditional in-browser web applications. To see examples of other members of the AngularJS community that are built on AngularJS, https://builtwith.angularjs.org/ is a phenomenal place. As AngularJS and its community mature, I suspect that the aforementioned question will become "Where isn't AngularJS?"

Without a talented and thriving developer community, AngularJS would not be the framework that it is today. The most apparent metric I found to measure this phenomenon is the rate at which the new versions of AngularJS are released. At its apex, it reaches 3 minor releases in 1 day and 5 minor releases per month in March 2014. To help the community and contributors keep up with the pace of development, the AngularJS core team maintains the website https://dashboard.angularjs.org/, which provides a real-time snapshot into the current build status of AngularJS's core. Because of its extensible design, contributors have also been able to enhance AngularJS's core through the development of third-party modules, services, filters, and directives. Some examples are the popular REST Angular module for consuming RESTful APIs, the Angular-UI frontend framework, Ionic Framework for mobile UIs, Firebase real-time data storage and syncing, and Yoeman generators for Angular.

What this book covers

Chapter 1, Our App and Tool Stack, explains the tooling process, which is one of the hottest topics in today's web development community, and AngularJS has a suite of tools that enhances your developer experience. You will learn about Angular's tool stack, how they fit together, and most notably, how they can help you deploy and maintain future applications.

Chapter 2, Deploying to Apache, explains why Apache, being the most popular web server environment, is a solid platform for hosting most Angular applications. You will get an opportunity to enhance Apache's default configuration to best support your Angular application. We will also discuss best practices to determine whether Apache is suitable for your type of application or whether an alternate infrastructure should be considered.

Chapter 3, Deploying to Heroku, discusses Heroku, which is one of the best platforms as a service. Its infrastructure empowers developers to spin up, deploy to, and scale their own Node.js servers at a minimal cost. Deploying to Heroku is a positive developer experience because its tool speed and efficiency are second to none.

Chapter 4, Deploying to Firebase Hosting, explains why Firebase has only been offering PaaS for a few months, but the promise of hosting your application code in the same environment as your real-time database has created a lot of interest around the Firebase services. You will learn how Firebase is preconfigured to optimally serve the AngularJS applications and how to further tailor Firebase Hosting to your application's needs.

Chapter 5, Deploying a Mobile App, explains why hybrid mobile apps is not a new idea, but the quality and tooling around it has made it a strong contender when building a mobile application. We will take our application's code and build it for Android/iOS using PhoneGap, Apache Cordova, and Cordova Chrome Apps.

Chapter 6, Deploying as Chrome Apps, explains why Chrome OS's adoption is growing at an exponential rate and the need for developers to support this platform is parallel in importance. Angular thrives in this environment, and deploying our application as a Chrome App for consumption on the Chrome Web Store/Chrome OS is an exciting frontier for both developers and consumers.

Chapter 7, Postdeployment, explains why deployment is no exception to the marketing adage of "rinse, lather, repeat", because it is never finished. Optimizing your workflow with best practices is necessary to ensure the longevity of your application. We will enhance our application and grok how to safely deploy the enhancement into production.

Chapter 8, Conclusion – AngularJS Deployment Essentials, explains that harnessing the tools will allow you to deploy a single AngularJS application to new platforms and new customers. We will discuss a few tips that will help you get the best out of these tools.

What you need for this book

The materials needed for this book include the, somewhat obvious, tools typically associated with most forms of web development. This includes a computer with the operating system of your choice, a stable Internet connection, an application to create and edit text files, basic working knowledge of your computer's command line, an instance of each modern web browser, and because it is paramount to stay hydrated while growing new information, water. All other software and tools needed to accomplish the examples in this book are covered in Chapter 1, Our App and Tool Stack.

Who this book is for

This book is designed to build your existing knowledge of AngularJS development with the tools and best practices necessary to successfully deploy an application into a stable production environment. Thus, prior understanding of HTML, CSS, JavaScript, the MV* architecture, and AngularJS are needed by you to fully implement the techniques and best practices covered in this book. If you have committed to this book and aren't feeling confident about the antecedent criterion, the AngularJS community has published a surfeit of free resources (listed as follows) that will adequately prepare you to assimilate the knowledge to come:

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "This file is called manifest.json."

A block of code is set as follows:

angular.module('krakn.controllers', ['ionic', 'ngAnimate'])
.controller('HomeCtrl', ['$scope', 'syncData', function($scope, syncData) {
  syncData('syncedValue').$bind($scope, 'syncedValue');
}]);

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

angular.module('krakn.controllers', ['ionic', 'ngAnimate'])
.controller('HomeCtrl', ['$scope', 'syncData', function($scope, syncData) {
  syncData('syncedValue').$bind($scope, 'syncedValue');
}]);

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "From the drop-down menu, select the Settings menu item near the bottom."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

From this point forward, I will use a few terms I consider to be relevant industry standard slang and acronyms to enhance your vocabulary when speaking with other developers, watching tutorial videos online, and reading associated literature or blog posts. These include the following terms:

  • Angular: This term is a shorthand name referring to all facets of AngularJS and its community.

  • Tool Stack: This term is used for a collection of tools encompassing all phases of the development process. These include, but are not limited to, boilerplates/seed projects, code editors, IDEs, code linters, command-line utilities, language abstraction compilers, package managers, local web servers, LiveReload, source/version control and their respective web applications, web browsers / BrowserStack, browser DevTools, testing runners, build tools, server communication clients, and others. For further information, Google search for slides from Paul Irish's presentation entitled Tooling & The Webapp Development Stack.

  • DevTools: This term is a shorthand name referring to the Google Chrome Developer Tools. Having contributed to the Chromium Open Source community, I am biased towards Google Chrome and most notably towards the Chrome Developer Tools.

  • PaaS: This term is an acronym for Platform as a Service.

  • CLI: This term is an acronym for command-line interface.

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 , 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.

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 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 , and we will do our best to address the problem.