Skip to content

Commit

Permalink
Update Angular profile docs to include changes to naming conventions …
Browse files Browse the repository at this point in the history
…and ability to change asset folder with config
  • Loading branch information
jameskleeh committed Jan 22, 2016
1 parent 8ac7b46 commit 7040ba2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/en/guide/webServices/REST/angularProfile.gdoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,37 @@ Example:
$ grails create-ng-controller foo
{code}

This will produce a fooController.js file in @grails-app/assets/javascripts/${default package name}/controllers@.
This will produce a @fooController.js@ file in @grails-app/assets/javascripts/${default package name}/controllers@.

{note}
By default the angular profile will create files in the @javascripts@ directory. You can change that behavior in your configuration with the key @grails.codegen.angular.assetDir@.
{note}

{code}
$ grails create-ng-domain foo.bar
{code}

This will produce a Bar.js file in @grails-app/assets/javascripts/foo/domains@. It will also create the "foo" module if it does not already exist.
This will produce a @Bar.js@ file in @grails-app/assets/javascripts/foo/domains@. It will also create the "foo" module if it does not already exist.

{code}
$ grails create-ng-module foo.bar
{code}

This will produce a @foo.bar.js@ file in @grails-app/assets/javascripts/foo/bar@. Note the naming convention for modules is different than other artefacts.

{code}
$ grails create-ng-service foo.bar --type constant
{code}

This will produce a bar.js file in @grails-app/assets/javascripts/foo/services@. It will also create the "foo" module if it does not already exist. The @create-ng-service@ command accepts a flag @-type@. The types that can be used are:
This will produce a @bar.js@ file in @grails-app/assets/javascripts/foo/services@. It will also create the "foo" module if it does not already exist. The @create-ng-service@ command accepts a flag @-type@. The types that can be used are:

* service
* factory _default_
* value
* provider
* constant

Along with the artefacts themselves, the profile will also produce a skeleton unit test file under @src/test/assets@ for each create command
Along with the artefacts themselves, the profile will also produce a skeleton unit test file under @src/test/javascripts@ for each create command

h4. Client side dependencies

Expand Down

0 comments on commit 7040ba2

Please sign in to comment.