raj

AngularJS, Front End Development

AngularJS : Adding Items to a JavaScript List and updating corresponding DOM Dynamically

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...

by raj
14-Sep-2012

AngularJS, Front End Development

AngularJS: Updating a Label Dynamically with User Input

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...

by raj
11-Sep-2012

AngularJS, Front End Development

AngularJS : A “Write Less Do More” JavaScript Framework

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...

by raj
11-Sep-2012

Grails

Applying Validation Constraints in Classes other than Domain classes and Command Objects

We usually specify validation constraints in domain classes and command objects. But, if it is required to provide validation in other classes(like classes in src/groovy), we can do so in two ways : 1. Defining a static constraints property in the class and using the @validateable annotation. 2. Defining a static constraints propery...

by raj
30-Aug-2012

Technology

Smart way of focussing a text input on page load for heavy pages

Let's say you have a login page which contains a form with username and password field in it (offcourse, along with a submit button). Let's say being much focussed towards user convenience with the user interface, you want to put the cursor in the username field of your form as soon as the page loads. You just go ahead and write- ...

by raj
27-Aug-2012

Grails

Groovier way of sorting over multiple fields in a list of maps in groovy

Recently I was working on a Groovy and Grails Development project and had a requirement to sort multiple fields in a list of maps. I needed to sort the below list of maps by firstName, then by lastName and then by ascending age. It means first, the firstNames will be compared. If they are same, lastNames will be compared and even if...

by raj
10-Aug-2012

Grails

Using Apache to save data in redis

In one of my projects, I was using redis database to collect some statistics and I thought of saving data into it at apache level. This would considerably enhance the speed of saving data as it would not require the interception of grails to save data. The first step for this was to install apache by firing the following command in...

by raj
30-Jul-2012