Angular 7 Databinding

Angular Data Binding serves the purpose of communication to communicate between the TypeScript code (the business logic) and the other component which is shown to the users i.e. HTML layout and hence is considered to be a dominant feature of Angular. The code written in TypeScript is compiled to JavaScript. The result so obtained is … Read more

Angular 7 ngStyle Directive

Style elements dynamically with ngStyle: To change or style the properties like value, color, and the size of the elements in Angular, the ngStyle attribute is used. Example 1: component.ts file: import {Component} from ‘@angular/core’; @Component( {selector: ‘app-server’, templateUrl: ‘server.component.html’}) export class ServerComponent { serverID = 20; serverStatus = ‘Online’;   constructor() { this.serverStatus = … Read more

Angular 7 ngIf Directive

Use of *ngIf directive to change the output conditionally: Example: component.ts file: import { Component, OnInit } from ‘@angular/core’;   @Component({ selector: ‘app-server2’, templateUrl: ‘./server2.component.html’, styleUrls: [’./server2.component.css’] }) export class Server2Component implements OnInit { allowNewServer = false; serverCreationStatus = ‘Server not created.’; serverName = ‘TestServer’; serverCreated = false;   /*constructor() { setTimeout(() =>{ this.allowNewServer = … Read more

Angular 7 Directives

Being the instructions in the DOM, the Directives defines the way to place the components and business logic in the Angular. They are the js class. Directives are declared as @directive. The ordinary HTML is combined with Angular directives and binding markup by a template. To create a new generic directive definition in the current … Read more

Angular 7 Components

The key features of Angular are its components. Being entirely based on components, Angular 7 consists of various components. These components form a tree structure with parent and child components. Different components are used in an application. Components are simple classes with decorators. They mark their types and present metadata to guide Angular to serve. … Read more

Angular 7 Architecture

For creating client applications in HTML and TypeScript, the Angular 7 was designed as a platform and framework which is written in TypeScript. The core and optional functionalities are thus implemented by Angular 7 as a set of TypeScript libraries to be imported into an app. For an Angular 7 application, NgModules are considered to … Read more

Angular Libraries

Angular 7 is a TypeScript based open-source full-stack web application. In simple words, it is a Javascript framework that is used to create reactive Single Page Applications (SPAs). Being entirely based on components, Angular 7 consists of various components. Built as a solution of general problems, Angular libraries are used for various problems like presenting … Read more

Angular CLI commands

Being a command-line interface tool, the Angular CLI is used to initialize, develop, scaffold, and maintain Angular applications. The commands can either be directly used on the command prompt or can be used indirectly through an interactive UI i.e. Angular Console. ng add Command: To add support for an external library to an Angular project, … Read more

Angular 7 with Bootstrap

To install Bootstrap for Angular project: Open the command prompt. Run the below command. npm install –save bootstrap@3 There will be an angular.json file instead of .angular-cli.json file, in case a project is created with Angular CLI 6+ (check via ng v ). In this case, add Bootstrap to the styles[] array in the angular.json … Read more

Angular 7 Files Explanation

Either of the Visual Studio Code IDE or the WebStorm IDE can be used for the Angular 7 app development. Both being equally good. Here, we are discussing the structure of the Angular 7 app on WebStorm IDE. Files used in Angular 7 App folder: The commonly used Angular 7 App files in a project … Read more