diff options
| author | Matias Niemelä | 2013-10-16 22:48:32 -0400 |
|---|---|---|
| committer | Matias Niemelä | 2013-10-23 17:00:12 -0400 |
| commit | a7e12b7959212f2fa88fe17d5a045cc9d8b22922 (patch) | |
| tree | 3613ad9f20a92eb9e7a88402e34a078092663cba /docs/src/templates/js/docs.js | |
| parent | 3f568b22f9bec09192588e3cae937db5c2e757f9 (diff) | |
| download | angular.js-a7e12b7959212f2fa88fe17d5a045cc9d8b22922.tar.bz2 | |
feat(docs): provide index pages for each angular module
Diffstat (limited to 'docs/src/templates/js/docs.js')
| -rw-r--r-- | docs/src/templates/js/docs.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js index fbabf193..2c5c56d2 100644 --- a/docs/src/templates/js/docs.js +++ b/docs/src/templates/js/docs.js @@ -207,6 +207,48 @@ docsApp.directive.sourceEdit = function(getEmbeddedTemplate) { } }; +docsApp.directive.docModuleComponents = ['sections', function(sections) { + return { + template: ' <div class="component-breakdown">' + + ' <h2>Module Components</h2>' + + ' <div ng-repeat="(key, section) in components">' + + ' <h3 class="component-heading" id="{{ section.type }}">{{ section.title }}</h3>' + + ' <table class="definition-table">' + + ' <tr>' + + ' <th>Name</th>' + + ' <th>Description</th>' + + ' </tr>' + + ' <tr ng-repeat="component in section.components">' + + ' <td><a ng-href="{{ component.url }}">{{ component.shortName }}</a></td>' + + ' <td>{{ component.shortDescription }}</td>' + + ' </tr>' + + ' </table>' + + ' </div>' + + ' </div>', + scope : { + module : '@docModuleComponents' + }, + controller : ['$scope', function($scope) { + var validTypes = ['property','function','directive','service','object','filter']; + var components = {}; + angular.forEach(sections.api, function(item) { + if(item.moduleName == $scope.module) { + var type = item.type; + if(type == 'object') type = 'service'; + if(validTypes.indexOf(type) >= 0) { + components[type] = components[type] || { + title : type, + type : type, + components : [] + }; + components[type].components.push(item); + } + } + }); + $scope.components = components; + }] + }; +}] docsApp.directive.docTutorialNav = function(templateMerge) { var pages = [ |
