Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

merged

  • Loading branch information...
commit 8f5881e1c453a32dd94d57571035a93450efa980 2 parents 37c9485 + 5ea2dc2
Vladimir Orany authored February 01, 2012
2  .settings/com.springsource.sts.grails.core.prefs
... ...
@@ -1,4 +1,4 @@
1  
-#Wed Feb 01 14:03:35 CET 2012
  1
+
2 2
 com.springsource.sts.grails.core.com.springsource.sts.grails.core.install.name=Grails 2.0.0
3 3
 com.springsource.sts.grails.core.use.default.install=false
4 4
 eclipse.preferences.version=1
2  .settings/org.codehaus.groovy.eclipse.preferences.prefs
... ...
@@ -1,3 +1,3 @@
1  
-#Wed Feb 01 14:03:35 CET 2012
  1
+
2 2
 eclipse.preferences.version=1
3 3
 groovy.dont.generate.class.files=true
3  .settings/org.eclipse.core.resources.prefs
... ...
@@ -0,0 +1,3 @@
  1
+#Wed Feb 01 11:57:19 CET 2012
  2
+eclipse.preferences.version=1
  3
+encoding//.link_to_grails_plugins/resources-1.1.5/grails-app/i18n/messages.properties=UTF-8
71  AngularjsGrailsPlugin.groovy
... ...
@@ -0,0 +1,71 @@
  1
+class AngularjsGrailsPlugin {
  2
+    // the plugin version
  3
+    def version = "0.2.1"
  4
+   // the version or versions of Grails the plugin is designed for
  5
+    def grailsVersion = "1.3.7 > *"
  6
+    // the other plugins this plugin depends on
  7
+    def dependsOn = ['resources':'1.0 > *']
  8
+    // resources that are excluded from plugin packaging
  9
+    def pluginExcludes = [
  10
+        "grails-app/views/error.gsp"
  11
+    ]
  12
+
  13
+    // TODO Fill in these fields
  14
+    def title = "AngularJS Plugin" // Headline display name of the plugin
  15
+    def author = "Vladimír Oraný"
  16
+    def authorEmail = "vladimir.orany@appsatori.eu"
  17
+    def description = '''\
  18
+Angular JS resources plugin. Uses 0.9.19 canine-psychokinesis release.
  19
+'''
  20
+
  21
+    // URL to the plugin's documentation
  22
+    def documentation = "http://grails.org/plugin/angularjs"
  23
+
  24
+    // Extra (optional) plugin metadata
  25
+
  26
+    // License: one of 'APACHE', 'GPL2', 'GPL3'
  27
+//    def license = "APACHE"
  28
+
  29
+    // Details of company behind the plugin (if there is one)
  30
+//    def organization = [ name: "My Company", url: "http://www.my-company.com/" ]
  31
+
  32
+    // Any additional developers beyond the author specified above.
  33
+//    def developers = [ [ name: "Joe Bloggs", email: "joe@bloggs.net" ]]
  34
+
  35
+    // Location of the plugin's issue tracker.
  36
+//    def issueManagement = [ system: "JIRA", url: "http://jira.grails.org/browse/GPMYPLUGIN" ]
  37
+
  38
+    // Online location of the plugin's browseable source code.
  39
+//    def scm = [ url: "http://svn.grails-plugins.codehaus.org/browse/grails-plugins/" ]
  40
+
  41
+    def doWithWebDescriptor = { xml ->
  42
+        // TODO Implement additions to web.xml (optional), this event occurs before
  43
+    }
  44
+
  45
+    def doWithSpring = {
  46
+        // TODO Implement runtime spring config (optional)
  47
+    }
  48
+
  49
+    def doWithDynamicMethods = { ctx ->
  50
+        // TODO Implement registering dynamic methods to classes (optional)
  51
+    }
  52
+
  53
+    def doWithApplicationContext = { applicationContext ->
  54
+        // TODO Implement post initialization spring config (optional)
  55
+    }
  56
+
  57
+    def onChange = { event ->
  58
+        // TODO Implement code that is executed when any artefact that this plugin is
  59
+        // watching is modified and reloaded. The event contains: event.source,
  60
+        // event.application, event.manager, event.ctx, and event.plugin.
  61
+    }
  62
+
  63
+    def onConfigChange = { event ->
  64
+        // TODO Implement code that is executed when the project configuration changes.
  65
+        // The event is the same as for 'onChange'.
  66
+    }
  67
+
  68
+    def onShutdown = { event ->
  69
+        // TODO Implement code that is executed when the application shuts down (optional)
  70
+    }
  71
+}
20  README.md
Source Rendered
... ...
@@ -0,0 +1,20 @@
  1
+# Grails AngularJS Plugin
  2
+
  3
+This plugin adds [AngularJS](http://angularjs.org/) resources to the Grails Application.
  4
+
  5
+It uses new [Resources Plugin](http://grails.org/plugin/resources) to handle resources gracefully.
  6
+Just let your AngularJS resources (services, controllers etc.) depend on 'angular' module and it's done.
  7
+To autobind AngularJS to the page require 'angular-autobind' module in the template.
  8
+
  9
+There is also controller for AngularJS scenario testing. Just navigate to `<app>/nge2e/<scenario-module-name>` to see the results.
  10
+The scenario module must depend on 'angular-scenario'.
  11
+
  12
+The plugin serves minified version for environments other than development. If jQuery plugin is installed
  13
+it automatically depends on it (inspired by great [Twitter Bootstrap Plugin](http://grails.org/plugin/twitter-bootstrap)).
  14
+
  15
+The plugin is not yet available on the grails repository, install it by running following command
  16
+
  17
+```
  18
+  grails install-plugin http://cloud.github.com/downloads/musketyr/grails-angularjs/grails-angularjs-0.2.1.zip
  19
+```
  20
+
4  application.properties
... ...
@@ -1,5 +1,5 @@
1  
-#Grails Metadata file
2  
-#Wed Feb 01 14:07:06 CET 2012
  1
+
3 2
 app.grails.version=2.0.0
4 3
 app.name=angularjs-resources
5 4
 plugins.resources=1.1.5
  5
+
54  grails-app/conf/AngularjsPluginResources.groovy
... ...
@@ -0,0 +1,54 @@
  1
+def dev = grails.util.GrailsUtil.isDevelopmentEnv()
  2
+def applicationContext = org.codehaus.groovy.grails.commons.ApplicationHolder.application.mainContext
  3
+def jqueryPlugin = applicationContext.pluginManager.getGrailsPlugin('jquery')
  4
+
  5
+def jsFile = dev ? "angular.js" :"angular.min.js"
  6
+
  7
+modules = {
  8
+	'angular' {
  9
+		defaultBundle 'angular'
  10
+		if(jqueryPlugin){
  11
+			dependsOn 'jquery'
  12
+		}
  13
+        resource id: 'angular', url:[plugin: 'angularjs', dir:'js/angular', file: jsFile], nominify: !dev
  14
+    }
  15
+	
  16
+	'angular-autobind' {
  17
+		defaultBundle 'angular'
  18
+		dependsOn 'angular'
  19
+		resource url:[plugin: 'angularjs', dir:'js/angular', file: 'angular-manual.js'], nominify: true
  20
+	}
  21
+	
  22
+	'angular-mock' {
  23
+		resource url:[plugin: 'angularjs', dir:'js/angular', file:"angular-mocks.js"]
  24
+			
  25
+	}
  26
+	
  27
+	'angular-scenario' {
  28
+		resource url:[plugin: 'angularjs', dir:'js/angular', file:"angular-scenario.js"], attrs: ['ng:autotest': true]
  29
+			
  30
+	}
  31
+	
  32
+	'angular-services'{
  33
+		dependsOn 'angular'
  34
+		defaultBundle 'angular'
  35
+	}
  36
+	
  37
+	'angular-controllers'{
  38
+		dependsOn 'angular-services'
  39
+		defaultBundle 'angular'
  40
+	}
  41
+	
  42
+	'angular-filters'{
  43
+		dependsOn 'angular-controllers'
  44
+	}
  45
+	
  46
+	'angular-widgets'{
  47
+		dependsOn 'angular-filters'
  48
+		defaultBundle 'angular'
  49
+	}
  50
+	
  51
+	
  52
+	
  53
+	
  54
+}
6  plugin.xml
@@ -19,7 +19,11 @@
19 19
     <repository name='mavenCentral' url='http://repo1.maven.org/maven2/' />
20 20
   </repositories>
21 21
   <dependencies />
22  
-  <plugins />
  22
+  <plugins>
  23
+    <runtime>
  24
+      <plugin group='org.grails.plugins' name='resources' version='1.1.5' />
  25
+    </runtime>
  26
+  </plugins>
23 27
   <runtimePluginRequirements>
24 28
     <plugin name='resources' version='1.0 &gt; *' />
25 29
   </runtimePluginRequirements>

0 notes on commit 8f5881e

Please sign in to comment.
Something went wrong with that request. Please try again.