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