Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate angular js into grails 2.3.4?

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!

like image 405
user2051347 Avatar asked Jan 28 '14 09:01

user2051347


People also ask

How to integrate UI-router with AngularJS?

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.

Is angular backward compatible with AngularJS?

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.

Should you upgrade Angular 8 to angular 10?

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.

Do I need typescript for angular 2?

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.


1 Answers

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.

like image 178
AA. Avatar answered Oct 15 '22 20:10

AA.