Home / 2017 / December

Monthly Archives: December 2017

What is the difference between Components and Directives in Angular.?

Today we are going to see ” difference between Components and Directives in Angular “. if you want to know more about angular components read “Angular 5 Components Tutorial” Basically, there are three types of directives in angular4 according to documentation. Component Structural directives Attribute directives Component is also a type …

Read More »

Angular 5 Interview Questions

Are you an Angular Developer then you should know Angular 5 Related information. in most of the interview, these Angular 5 Interview Questions are asking. What’s new In Angular 5? What Is the Difference Between Angular 4 and Angular 5? How to setup guide for Development and Unit Test Environments? …

Read More »

Angular 5 Deployment – Deploy your Angular App

Creating a Build As mentioned, we need to use the Angular CLI to create a build of our app. Hop into the console within the project folder and run the following command: $ ng build This will take 5-20 seconds to run. The end result is a new folder called …

Read More »

Creating and Using Angular 5 Services

Generating the Service File The robust Anguar CLI tool will allow us to quickly and easily generate a service file for our project. Hop into your console within the project folder and run the following command: $ ng generate service data Note: You can use ng g s data as …

Read More »

Using the Angular 5 Router

Working in the App Routing File When we started this project with the Angular CLI, we used the –routing flag, which set us up with a file located at /src/app/app-routing.module.ts, visit this file and import the 2 components we created earlier: import { NgModule } from ‘@angular/core’; import { Routes, …

Read More »

Angular 5 Animation Tutorial

Installing the Animation Library Until recently, the Angular Animation library was installed by default. But now, we have to add it manually. Visit the console in the project folder and type: $ npm install @angular/animations@latest –save Next, in /src/app/app.module.ts we need to import it: // Other imports removed for brevity …

Read More »

Angular 5 Interpolation, Property Binding & Event Binding Tutorial

Interpolation Whenever you need to communicate properties (variables, objects, arrays, etc..) from the component class to the template, you can use interpolation. The format for defining interpolation in a template is: {{ propertyName }} Open up the /src/app/home/home.component.ts component file that we’ve been working on and define the following property …

Read More »

Angular 5 Template & Styling Tutorial

Defining a Template Open up the /src/app/home/home.component.ts file that the CLI generated earlier: Notice templateUrl? This is a property that expects an external HTML file that will serve as the template for this component. If you change it to the template, you can specify inline HTML like below: We don’t …

Read More »

Angular 5 Components Tutorial

Taking a look at our project.. If you open up our new Angular 5 project in a code editor (I’m using Visual Studio Code), it will look like this: For the most part, when you’re developing, you’re only going to be working within the /src/ folder. What are Components? Angular …

Read More »