diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index 010de8e419b5c..676b007a6629e 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -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 @@ -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. diff --git a/src/ui/public/modules.js b/src/ui/public/modules.js index 6e90f8fa5bcf0..d0b4c42f19b9b 100644 --- a/src/ui/public/modules.js +++ b/src/ui/public/modules.js @@ -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');