Hi, Currying is a very simple and useful concept in JavaScript. Here we can set the context of the function to any object or variable. So let us study this concept using the practical examples and code as follows: [js] //Let us first create a function "curry" function curry(thisObject, func){ return...
Hi, When working with JavaScript, we might sometimes require to run some regEx on a string and replace its matches logically. This can be easily done using the String:replace() method. Lets Take an example to understand the concept: Suppose we want to write a function which converts the normal string to CamelCase...
AngularJS, Front End Development
In all previous blogs on AngularJS, we used hard coded data. Now, its the time to get more dynamic and play with the data fetched from the server. For this, we will use AngularJS dependency injection which injects various services into the controller. To use a service is even more simpler. We just declare the name of the service as an...
AngularJS, Front End Development
In last blog on AngularJS, we implemented text suggestions functionality. Now, let's consider that we have a list of objects with each object having two or more attributes with their corresponding values. The problem is to get the sorted list of objects based on an attribute selected by user at run time. AngularJS provides us a very quick...
AngularJS, Front End Development
Let's implement text suggestions functionality using AngularJS. It provides suggestions while we type into the text field. For example, if we have a list of fruits and the user types 'ap', it will show all fruit names that contain these letters. [html] <!Doctype html> <html ng-app> <head> ...
AngularJS, Front End Development
I hope you found my previous blog helpful which was about Updating a Label Dynamically with User Input on AngularJS and this blog uses the concept of MVC. Let's consider the following example : [java] <!doctype html> <html ng-app> <head> <script...
AngularJS, Front End Development
After the basic introduction of AngularJS, we are all set to write code for implementing a simple functionality. Let us consider a simple scenario. There is a textbox, and whenever the text in it changes we need to update a label dynamically. Traditional way of doing this in Javascript is to bind the change event of the textbox, such...
AngularJS, Front End Development
AngularJS is a javascript framework which helps to make html pages more dynamic with the least possible code. The idea is to write less, do more. AngularJS is based on the concept of MVC ( Model, View & Controller ). Model : It consists of the data that flows in the application. Before the advent of AngularJS, whenever there...
Some of the commonly faced problems are: 1) In case we give different width combinations for cells of different rows, the width combination of first row is accepted and subsequent combinations are neglected. [html] &lt;tr&gt; &lt;td...
In this post, we will learn how to use javascript as MongoDB shell script to export (fields of) a collection. If you just want to execute MongoDB commands then look at the another post there.. OK, so let's focus back to the objective of this post. Generally, to export data from a MongoDB collection, we use the...
In my recent grails project, i needed to integrate LinkedIn with the application using LinkedIn API. I searched a lot about it and find the Java wrapper of linkedIn to use it with my grails application and thought it worth sharing. LinkedIn uses OAuth2.0 protocol for authorization when our application tries to access the data. ...
Ext.JS JavaScript Framework a cross-browser JavaScript library for building rich internet applications. It is built for developing high performance, customizable UI widgets and features a well designed, documented and extensible Component model. It is available in both Commercial and Open Source licenses are available. Step 1: First...