Categories
Angular 2

How to deploy angular universal to production

This post will cover the step needed to take the angular universal app to the production server. This post assumes that you have running angular universal application and which is generated by angular CLI. Now open your terminal or command prompt, point the cursor to the project folder and run the build command as shown […]

Categories
Angular 2

How to Deploy an Angular app in Production with Nginx

This tutorial I will show you Nginx installation and configuration steps to serve Angular application in production. I am gonna use Ubuntu 16.04 operating system. Install and Configure Nginx for Angular First update the apt-get package lists and then install Nginx using apt-get: Then open the default file to configure server which is located in […]

Categories
Angular 2

Cascading dropdown in Angular

In this article, you will learn how to use cascading DropDownList using Angular application. In following tutorial you gonna use Angular CLI to create an application. Here is the official website of Angular CLI. Why Angular CLI The Angular CLI makes it easy to create an application that already works, right out of the box. […]

Categories
Angular 2

Angular – Global API service request method

Using HTTP service directly in all over the application is not scalable, its only work for small applications. Having a central location to manage HTTP calls, will reduce the maintenance and its robust solution. We can inject this global service into any component. Global API service request method Lets create a new service called APIService, […]

Categories
Angular 2

Angular NgSwitch Directive

The NgSwitch directive lets you to insert different sets of elements into the document based on a specified value or expression.NgSwitch Directive resides inside CommonModule module, so you can import it as shown below How to use NgSwitch In the below code, we are getting iterating over the items objects, to show the status of […]

Categories
Angular 2

Angular 4 – Add dynamic class to the body based on route.

Inside the root app component, Inject the Router and subscribe to route change events and detect the NavigationStart event with the event type instance, its called NavigationStart. With the Renderer2 class we can add and remove class to the body as shown below.

Categories
Angular 2

How to Apply CSS Classes Conditionally in Angular 2

Angular 2 provide different ways to apply class to the elements based on certain conditions. In this post I would like to show you couple of ways to conditionally applying class to a DOM element in Angular 2 with ngClass. Methods to Apply CSS Classes Conditionally

Categories
Angular 2

Angular 2 – Async Validator – Username/email availability check

In this post I will show you, how we can create custom async validator to check for email availability, same logic you can apply for username or other async validations. Lets create a component: Here is my user service: Backed server response for unregistered email will be null and for registered email address will be […]