Month: March 2018

Concept of JavaScript Closure

Javascript closure is the very important concept of JavaScript. The closure allows programmers to write better code. We have already used closure much time but not able to identify that this is the closure. This is the common interview question for JavaScript developer. What is closure? A closure is a combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function’s scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time. In a simple way closure… Read More

Read More »

How to create component in using angular CLI

angular set up

Prerequisites To install Angular CLI, Run the following command.

Create Component and Service We can use either ng generate or ng g only to generate component/service. By using ng generate we can create component, Directive, Service and Pipes. Examples  Component : To create component run the below command.

After successful execution, you will find your component in your project. In your project, you will be able to see four files .html, .css, .spec.ts and .ts  Please follow and like us:

Read More »