Using AngularJS with Grails app… my first impression

In my current grails application, we have started using the AngularJS after realizing that the GSP template engine is a bit slow. Now, I realize how efficient AngularJS can be, and think of sharing my first impressions while using AngularJS with grails app. Following are some of the reasons, that I find, makes AngularJS stands out:

  1. The aim of AngularJS to develop single page applications makes it really fast and efficient.

  2. We are able to save the compilation time of the gsp pages, as we use just plain html pages. Angular also caches these html pages, thereby, making the rendering even more faster.

  3. Besides providing a lot of predefined directives, we can also create our own directives. This makes it more powerful, testable, clean and easier to maintain.

  4. Two way binding saves a lot of time, effort and extra javascript code. We can do without using the costly iteration of the DOM elements. One such case is when we use the inbuilt validation framework. The validation messages could easily be shown while the user keys in his input.

  5. MVC pattern ensures less coupling between the presentation, data and logic components. Thus, making the javascript code easily testable.

  6. Filters are very powerful to filter out existing data in the view layer. In addition to many predefined filters, we can also create our custom filters.
FOUND THIS USEFUL? SHARE IT

comments (5)

  1. Fui Nusenu

    Just to update on this, instead of using grails internationalization we ended up using angular translate which was much faster. If anyone wants details, just reply this comment.

    Reply
  2. Fui Nusenu

    We also used angularjs in our app and it was quite fast… But recently we needed the power of grails internationalization to render our templates into other languages and hence we changing all our partials and views to gsp files to enable internationlization support. Also there won’t be a much of a difference since we preload all the templates when the app starts and hence any compilation time wasted loading the gsp pages will not be felt by the user since its loaded before the page is accessed

    Reply
    1. Django

      Hi Fui Nusenu , Internationalization is also possible with Angular JS, you can use “Pascal Prects” i18n which is useful and easy to implement

      Reply

Leave a Reply to Django Cancel reply

Your email address will not be published. Required fields are marked *