Reputation: 655
Need a direction.
Which approach is better when building Grails with AngularJS app.
https://github.com/hantsy/angularjs-grails-sample
Basically what are the advantages of one over the other.
Thanks is advance
Upvotes: 3
Views: 1768
Reputation: 50245
It is too broad a question to answer. As a whole, the answer will be: "It depends.."
I personally don't believe there is any advantage of one over another approach if all you get is one web application. However, the example you are referring to does not have the client and server implementation in one war.
Client implementation is a Node.js app which hosts the Angular component. Angular makes REST calls to Node web server which in turn makes corresponding REST call to the Grails app.
Alternatively, this can be achieved by hosting the angular component inside assets
(according to point 1 in the question) in Grails app itself. Static assets (ng/js/css/html) will be served from here (with the help of asset-pipeline plugin), thus removing the need of the Node.js app as stated earlier.
Once again, which approach supersedes other is a broader discussion and differs from person to person.
However, if you have not kept track of recent developments in latest version of Grails then there is a newly available Grails profile for Angular. On the other hand, Node, Express, Angular (v2 recently) has been a hot cake as well as far as Client side is concerned.
So it would be wise to do more research on this and decide which fits best to the team and ultimately to the organization.
Upvotes: 3