Permalink
Browse files

merged

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

0 comments on commit 8f5881e

Please sign in to comment.