3

I have a similar problem of using Angular with Grails, pls. refer this question that already gives all the details/solutions/answers: How to integrate angular js into grails 2.3.4?

In the answers to this question, people have given good answers, but they are talking about ....

"require the module on screen"

... & sample code (?) fragments like these:

//= require angular/angular.js
//= require_tree views
//= require_self

What is the meaning of "requiring" the module ("resource bundles": as given in the first answer), & other/above code fragments, or whatever they are.

Does it means normal require statements:

require(['angular']);

etc.?

Things are not very clear.

Community
  • 1
  • 1
  • I am an experienced developer & business professional, with 10 yrs. in systems software, 5 yrs. in business & innovation; & I am new to Web-Development. – Mayank Kulshreshtha Jan 20 '15 at 05:59

3 Answers3

3

In a Ruby on Rails application you would use manifest files to include all your dependencies. That is a code snippet from the application.js (default) manifest file where it's including javascript files or paths using the "//=" javascript include syntax.

Stone
  • 2,608
  • 26
  • 26
1

Grails uses different resource mangement plugins for javascript files, css, images, etc.. Code you mentioned

//= require angular/angular.js
//= require_tree views
//= require_self

is from grails asset-pipeline plugin.

Resource bundles term used in grails resources plugin where you declare bundles in ApplicationResource.groovy file.

When you want set of js or css file to be included in a page you just need to include manifest file (for assest pipeline) or require module (for resources).

Both plugin have good documentation to refer.

Kishor Sharma
  • 599
  • 8
  • 15
0
//= require angular/angular.js

Is simply rails syntax for requiring and registering dependencies to your rails applications. Although your question is a little vague if you are trying "require an angular module" than you must list it as a dependency when you declare your angular module. This is totally unrelated to rails but will look something like this:

angular.module('myApp', ['ngRoute', 'ngTouch',])

where the items inside the array (ngRoute, ngTouch) are other modules that become depencies of 'myApp'.

This page should help!

Maxwelll
  • 2,174
  • 1
  • 17
  • 22