I am running on grails 2.3.4
and though about integrating angularjs in my next application.
I think the best way from the server side is to use grails REST
integration in the domain and controller classes.
However here I am stuck.
How to get grails to communicate with angularjs?(over the index.gsp
?, If so how to integrate it?) What would be a good architecture?
I really appreciate your answers!!!
PS.: I know that there is a grails angular js plugin. However I do see any reason for using that!
It is an easy two-step process: Import "@uirouter/angularjs/release/stateEvents". Add "ui.router.state.events" with other UI-Router dependencies to the AngularJS app module dependencies. Example code is shown below.
Even though Angular is not backward compatible with AngularJS, it provides an official way to ease step-by-step migration. The ngUpgrade library provides tools to mix and match AngularJS and Angular code inside a hybrid application.
As Angular authors have amazed the development community with rapid releases of Angular 9 and Angular 10 frameworks, these newer versions also introduced some breaking changes. Therefore, Angular 8 applications that are subject to be upgraded even further should be evaluated on a case-by-case basis.
Technically Angular does not need TypeScript to work. (It works with JavaScript and even Dart .) However, if you decide to use TypeScript, you could set it up and use it in advance. With TypeScript ready, this gives you one less thing to worry about when planning for the actual migration. @types/angular should help you set it up.
We have two projects as two separate worlds. The first project, the server side, is in grails. We are creating 'restful' services. This project knows nothing about angular or resource plugin or asset pipeline; not even uses gsp views, only json
responses. In future we can to use that 'api' to build mobile clients or to exchange information with another service, etc.
The other side, the client, knows nothing about grails. It's all statics pages with html 5
, javascript and angularjs framework.
I believe that 'it' is the paradigm that everybody will begin to adopt from now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With