@@ -207,28 +207,29 @@ docsApp.directive.sourceEdit = function(getEmbeddedTemplate) {
207
207
}
208
208
} ;
209
209
210
- docsApp . directive . docModuleComponents = [ 'sections' , function ( sections ) {
210
+ docsApp . directive . docModuleComponents = function ( ) {
211
211
return {
212
212
template : ' <div class="component-breakdown">' +
213
213
' <h2>Module Components</h2>' +
214
- ' <div ng-repeat="(key, section) in components">' +
215
- ' <h3 class="component-heading" id="{{ section.type }}">{{ section.title }}</h3>' +
216
- ' <table class="definition-table">' +
217
- ' <tr>' +
218
- ' <th>Name</th>' +
219
- ' <th>Description</th>' +
220
- ' </tr>' +
221
- ' <tr ng-repeat="component in section.components">' +
222
- ' <td><a ng-href="{{ component.url }}">{{ component.shortName }}</a></td>' +
223
- ' <td>{{ component.shortDescription }}</td>' +
224
- ' </tr>' +
225
- ' </table>' +
214
+ ' <div ng-repeat="(key, section) in components">' +
215
+ ' <h3 class="component-heading" id="{{ section.type }}">{{ section.title }}</h3>' +
216
+ ' <table class="definition-table">' +
217
+ ' <tr>' +
218
+ ' <th>Name</th>' +
219
+ ' <th>Description</th>' +
220
+ ' </tr>' +
221
+ ' <tr ng-repeat="component in section.components">' +
222
+ ' <td><a ng-href="{{ component.url }}">{{ component.shortName }}</a></td>' +
223
+ ' <td>{{ component.shortDescription }}</td>' +
224
+ ' </tr>' +
225
+ ' </table>' +
226
226
' </div>' +
227
227
' </div>' ,
228
228
scope : {
229
229
module : '@docModuleComponents'
230
230
} ,
231
- controller : [ '$scope' , function ( $scope ) {
231
+ controller : [ '$scope' , '$anchorScroll' , '$timeout' , 'sections' ,
232
+ function ( $scope , $anchorScroll , $timeout , sections ) {
232
233
var validTypes = [ 'property' , 'function' , 'directive' , 'service' , 'object' , 'filter' ] ;
233
234
var components = { } ;
234
235
angular . forEach ( sections . api , function ( item ) {
@@ -239,16 +240,17 @@ docsApp.directive.docModuleComponents = ['sections', function(sections) {
239
240
components [ type ] = components [ type ] || {
240
241
title : type ,
241
242
type : type ,
242
- components : [ ]
243
+ components : [ ]
243
244
} ;
244
245
components [ type ] . components . push ( item ) ;
245
246
}
246
247
}
247
248
} ) ;
248
249
$scope . components = components ;
250
+ $timeout ( $anchorScroll , 0 , false ) ;
249
251
} ]
250
252
} ;
251
- } ]
253
+ } ;
252
254
253
255
docsApp . directive . docTutorialNav = function ( templateMerge ) {
254
256
var pages = [
@@ -411,7 +413,7 @@ docsApp.serviceFactory.prepareDefaultAppModule = function() {
411
413
var moduleName = 'App' ;
412
414
return {
413
415
module : moduleName ,
414
- script : "angular.module('" + moduleName + "', [" +
416
+ script : "angular.module('" + moduleName + "', [" +
415
417
( deps . length ? "'" + deps . join ( "','" ) + "'" : "" ) + "]);\n\n"
416
418
} ;
417
419
} ;
@@ -709,7 +711,7 @@ docsApp.controller.DocsController = function($scope, $location, $window, $cookie
709
711
error : 'Error Reference'
710
712
} ;
711
713
712
- populateComponentsList ( ) ;
714
+ populateComponentsList ( ) ;
713
715
714
716
$scope . $watch ( function docsPathWatch ( ) { return $location . path ( ) ; } , function docsPathWatchAction ( path ) {
715
717
// ignore non-doc links which are used in examples
0 commit comments