Add multiple classes conditionally in Angular 2

When you will start developing a Application using Angular 2, you might got into  a situation where you need to Add multiple classes conditionally in Angular 2 to one HTML element. For adding a single class conditionally, read this article. There are various ways using which you can change style of any element, you can read everything about that in above link. Let’s first discuss in which situation we might need to add multiple classes conditionally in Angular 2. Let us consider a basic Angular 2 component as below:

Now you might want  to show “Download CSV” button at some …

Continue Reading

Angular2 : Class binding and Style binding

This article will take you through following: How to add class conditionally in Angular v-2 , How to add inline style in Angular v-2,  What is the concept of Class binding and style binding.  In Angular 1, conditionally adding a class require the use of ng-class directive. But in Angular 2, same can be achieved by using ngClass or ngStyle directives . So below is the possible way to achieve the same in Angular 2. Methods for adding or removing class based on Property are as following: Class Binding ngStyle or inline style binding NgClass (Better choice when need to add …

Continue Reading

Getting hands on with Shell Scripting

From a long back i wanted to get my hands dirty with Shell script language. I just love commanding Kernel to do things that it can do like File processing, Getting hardware information etc. I just started from pretty much basic stuff. First of all, i started looking for tutorials that can provide me syntax of all basic commands. I started with one website and after a hour or two, i started felling bored of reading stuff (Awwwww!!! I was never good at reading stuff). After this i started searching for Video tut and i find one which have all …

Continue Reading

Get user ip using Javascript/jQuery

You can get user ip address for logging or for some other purposes. You can get exact ip address of user using the following jQuery code.

Also Read: — Difference between Jquery Prop and attr function

Continue Reading

Run pm2 with Environmental Variable

PM2 is an advanced production process manager for Node JS. You can get better reports, info about your running apps on Node JS Server. The best service that i got till now to host Node JS application is Digitalocean. They provide you with private VPS (a.k.a droplet) where you can run your Node JS applications. If you are looking for VPS, i suggest you to signup using this link. We can run your app.js with PM2 as following:

Normally if you want to run you Node JS app with Env_var, you can do it like this:

But Now if …

Continue Reading

Run MongoDb in Background

if you are looking for a way so that you can run your mongodb as a background process then you have to add –fork as a parameter. In order to Run MongoDb in background, you need to run following command.

–dbpath : database directory path. –port : port on which db will be running. –fork : this will allow this process to run in background, so this parameter is must. — logpath : path for logfile. Also Read :  Get user ip using Javascript/jQuery  Run pm2 with Environmental Variable  

Continue Reading

Firebase + Ionic issues

I had started working on Firebase in my last Project couple of days back. It was a quite fun working with such a awesome cloud based back-end service with build in API’s and features like Authentication, database and Storage. But i had to deal with some of Firebase-ionic issues. You can find more info here. If you are new to Firebase then i will highly recommend you going through Official Documentation + Video tutorial. I was working on building hybrid application using Ionic + Cordova +Angularfire + Firebase. I am writing this because i faced couple of issues while working …

Continue Reading

Life is beautiful

Life is really beautiful, you just have to be patient, learner, curious & know how to enjoy. There is always a morning after a long night. You can never be the same man as you use to be but wise man is who, who can be even better after all the changes he had gone through. There are lot of things that you might lost in that dark night but man should constantly try to regain what he had lost as somebody wisely said there is nothing impossible in this world. Today after a long time i again start writing …

Continue Reading

Check ionic platform is browser or Mobile Device

In Ionic application development there will be several instances where you wanna target browser and mobile device differently. By using below code you can check ionic platform.

As soon as ionic.platform is ready, you can check weather‘browser’) is true or false. Based on Also Read:  Get user ip using Javascript/jQuery  Run pm2 with Environmental Variable

Continue Reading

Things that every React Developer should know

I have started learning React JS around 6 months before and i love learning it day by day. React JS is a library which is used to build UI.In React JS is that, you build your application UI as a combination of Components. It provides code maintainability and high flexibility to design as whole UI consists of very small components.  Also React JS use virtual DOM to re-render components when any change happen in the Component and it’s blazing fast. In this article i have included concepts which i think React Developer should know. This post assumes that you are …

Continue Reading