Skip to content

Commit

Permalink
[ui/modules/docs] moved recommendations to the styleguide
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Dec 18, 2015
1 parent ed3feea commit 9f2e32e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion STYLEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ Angular modules are defined using a custom require module named `ui/modules`. It
var app = require('ui/modules').get('app/namespace');
```

`app` above is a reference to an Angular module, and can be used to define controllers, providers and anything else used in Angular.
`app` above is a reference to an Angular module, and can be used to define controllers, providers and anything else used in Angular. While you can use this module to create/get any module with ui/modules, we generally use the "kibana" module for everything.

### Private modules

Expand All @@ -838,6 +838,8 @@ app.controller('myController', function($scope, otherDeps, Private) {
});
```

*Use `Private` modules for everything except directives, filters, and controllers.*

### Promises

A more robust version of Angular's `$q` service is available as `Promise`. It can be used in the same way as `$q`, but it comes packaged with several utility methods that provide many of the same useful utilities as Bluebird.
Expand Down
5 changes: 0 additions & 5 deletions src/ui/public/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
* Private modules are able to find any dependency, since they are injected using the
* "kibana" module's injector.
*
* RECOMMENDATIONS:
* - just use the "kibana" module for everything
* - rely on js modules for modularity
* - use Private modules for everything except directives and filters
*
*/
define(function (require) {
var angular = require('angular');
Expand Down

0 comments on commit 9f2e32e

Please sign in to comment.