Security is the biggest concern while building web applications. Most of the web applications handle a lot of sensitive data and it is necessary to provide adequate security to protect this data from perpetrators. This series of articles discuss various security issues, types of attacks and guidelines to be followed for building a  secure application. Front-end    The basic security features that should be implemented in every web applica...

While working with Node.js and Angular, sometimes you might need to set some custom values in Response Header from the server-side and get these values in your Angular application. These values can be some tokens, keys or anything. This article is about completing this requirement. Server-side using Express.js and Node.js To set a custom value in the response header, you have to write the following code in your Express.JS server [crayon-5d5ac82b...

1 What is typescript? It is a strict syntactical superset of JavaScript, and adds optionaltype-checking along with the latest ECMAScript features. 2 What is two way data binding in angular? Two-way Binding. Data binding in AngularJS is the synchronization between the model and the view. When data in the model changes, the view reflects the change, and when data in the view changes, the model is updated as well. Binding   3 Types of bindings ...

While creating AngularJS applications,we might need to send multiple  http requests to backend apis to fetch the data that need to be populated within our HTML.In most cases, these backend apis might be protected using token .Also we might need to add a loading image to indicate the user that the data is being fetched. HttpInterceptor helps us to a display the loader image before and hide the loader image after completing the request  and also...

Angular 1.6 SPA server side pagination of data with sort. To create a SPA which lists user data with pagination  and sorting we need the following CDN links – Angular JS 1.6.9 js CDN. – Angular JS UI bootstrap -Bootstrap components written in pure AngularJS . – Bootstrap CSS file. STEP 1 – Create file index.html and add the relevant CDN links using the following codes. [crayon-5d5ac82b3372e232435372/] STEP 2 – CREA...

HttpInterceptor –  feature in Angular 4.3. We may need to intercept Http request while building apps with Angular. Sometimes we may you need to intercept Http request to add something to request header or to do something with the response. We can use Http Interceptor to do some action when sending  a request.This can be achieved using  the following interceptor class which implemenets Httpinterceptor.The interceptor adds an ‘acces...

Node.js is an open source server environment which lets us write server side code in javascript. Node.js is asynchronous,single threaded and non-blocking .Node.js has very high memory efficiency which makes it very popular in server side  developement for web/mobile app.In this article we take a look at how to start of web developement in Node.js with Mysql as database. To install Node.js in your linux run the following command in the terminal [...

Filter function in javascript filters an array based on a given criteria and returns new array.For example if we want to get all elements in an array divisible by 2 as a new array,we can use filter function [crayon-5d5ac82b36aac377726577/] Just for a reference check what the map function gives in return [crayon-5d5ac82b36ab3564533636/]   Now lets’s go back to filter function.Lets see how filter function works on array of objects. [cray...

  Javascript strings are immutable.But javascript objects and arrays are mutable.A mutable object is an object whose content can be modified after it is created. An immutable object is an object whose content cannot be modified after it is created. Consider an the following example [crayon-5d5ac82b37280875121283/] Now,from the above we realize that arrays and objects in javascript are mutable,ie they can be mutated. Functions like slice retu...

Angular is based on  component.It is having component within component architecture.Change detection look for changes in bindings from root to leaves from top to bottom. The library Zone.js lets Angular find out when to update the DOM. Angular performs change detection on component and child components when some changes occur in your App.But as the number of components increases change detection becomes heavy.In order to tackle this we can do...



Comparison operations in javascript
Javascript / June 1, 2018

Javascript provides three types of comparison Abstract equality (Achieved using ===) Strict equality (Acheived using ==) [crayon-5d5ac82b22414365729752/] In the above example a is a number and b is a string .If we compare strictly with === the result would be false and if we compare loosely with operator == the result would be true.The abstract equality operator returns true irrespective of the type.Loose equality compares two values fo...

Array reduce functions in Javascript
Javascript / June 1, 2018

The reduce() method applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.Reduce function makes it to a single value. [crayon-5d5ac82b229fb004422250/] Here we can see reduce always accepts a call back function. The variable a  is called the accumulator in which the return value is stored The variable b represents each variable inside the array.Thus what reduce does...

Array map functions in Javascript
Javascript / June 1, 2018

Conside a Javascrpt Array of numbers.We need to make an array which contains squares of all these numbers.What we can do to achieve this is using a for loop. [crayon-5d5ac82b22c54291343138/] For doing these Javascript has another function called MAP function on array.Using the map function the above result can be achieved in the following way [crayon-5d5ac82b22c5b461119983/] Array Map on Array of objects in Javascript [crayon-5d5ac82b22...

OOPS and PHP
PHP / May 31, 2018

In this section we will look at OOP with PHP . Refering the below explanations prior to interviews will surely help you to answer some of the most common questions an rookie/intermediate level developer might face in interviews.Here is a diagram depicting object oriented programming concepts CLASSES In object-oriented programming , a class is a template definition of the method s and variables in a particular kind of object . Thu...

php and oops interview questions
interview questions / May 31, 2018

What is Object Oriented Programming? Object-oriented programming (OOP) is a programming language model organized around objects rather than functions as in procedural programming; Objects are instances of classes, are used to interact with one another. What are the advantages of OOPS concepts? Major advantages of OOPS programming are; Simplicity: OOPS programming models on  objects, so the complexity is reduced and the program structur...

js/nodejs/angularjs/ts interview questions
interview questions / May 31, 2018

1  What is data binding in angularjs Data binding in AngularJS is the synchronization between the model and the view.                                      2  What are the key features of angularjs    Modules.    Directives.    Expressions.    Controller.    Scope.    Data Binding.    Validations.    Filters.    Services.  Routing.  Dependency Injection.  Testing. 3  What are directives AngularJ...

js (ES6,ES7,ES8),OOPS js,Node.js
Javascript / May 31, 2018

ABOUT JAVASCRIPT JavaScript  is an interpreted language.A program such as C++ or Java needs to be compiled before it is run. The source code is passed through a program called a compiler, which translates it into bytecode that the machine understands and can execute. In the case of javascript  an interpreter  reads over the JavaScript code, interprets each line and runs it.Google’s V8 increases performance by compiling...

Angularjs and ts(Angular 5)
Javascript / May 31, 2018

WHAT IS ANGULAR JS AngularJS is a JavaScript framework. It is written in JavaScript.AngularJS extends HTML attributes with DIRECTIVES, and binds data to HTML with EXPRESSIONS.With AngularJS we can create single page applications(SPA) The following are the key features of AngularJs: Modules. Directives. Expressions. Controller. Scope. Data Binding. Validations. Filters. Services. Routing. Dependency Injection. Testing. [crayon-5d5ac82b2...

Understanding ‘this’ in Javascript
interview questions , Javascript / March 20, 2018

This in Javascript refers to the object to which the function belongs. The value of this is determined by how a function is called.’This’ refers to the “owner” of the function.In the case of a normal function like below ‘this‘ refers to the global object (window object) [crayon-5d5ac82b25b01726157914/] In the above example, a function WrapAll() is being called from the global scope. The global scope ...