(Quick Reference)

1.1.3 Angular Support

Version: 3.2.9

1.1.3 Angular Support

AngularJS Scaffolding

The angularjs profile has been refined and now also includes a new AngularJS Scaffolding plugin.

The AngularJS scaffolding plugin adds an ng-generate-all command which will generate the necessary AngularJS 1.x client code to perform CRUD operations in conjunction with a Grails 3 backend.

Not only does this serve as a useful tool to get up and running quickly, but (like previous versions of scaffolding) it is a great way for developers to learn how to integrate AngularJS and Grails 3.

Angular Profile (3.2.1+)

Starting with Grails 3.2.1, the Angular profile is available for use to create applications with Angular 2+. To create a fresh application:

grails create-app test-ng -profile angular

A multi-project build will be created with a separate project for the client and server applications. To make things easier, the tasks test, integrationTest, and bootRun have been created in the client application to make executing those tasks easier across the whole application.

Since Gradle executes tasks synchronously, and the bootRun task will never finish, it is important to execute it in parallel. At the root of the project:

./gradlew bootRun --parallel

This will start both the client and server side applications simultaneously.

For more information on how the new profile works, see the section in the user guide.

Profile and Scaffolding Renamed (3.2.9+)

Previously in Grails 3.2.8, the angular profile created applications with Angular 1.x and the angular2 profile created applications with Angular 2.x.

Because of the naming guidelines coming from the Angular team, the angular profile was renamed to angularjs. The angular2 profile was renamed to just angular. The scaffolding plugins were also changed in the same manner.