File tree Expand file tree Collapse file tree 6 files changed +55
-8
lines changed Expand file tree Collapse file tree 6 files changed +55
-8
lines changed Original file line number Diff line number Diff line change @@ -92,11 +92,11 @@ angular.module('sgApp', [
92
92
93
93
function loadModule ( $ocLazyLoad ) {
94
94
if ( window . filesConfig && window . filesConfig . length ) {
95
- var fileNames = [ ] ;
96
- angular . forEach ( window . filesConfig , function ( file ) {
97
- fileNames . push ( file . name ) ;
95
+ var moduleNames = [ ] ;
96
+ angular . forEach ( window . filesConfig , function ( lazyLoadmodule ) {
97
+ moduleNames . push ( lazyLoadmodule . name ) ;
98
98
} ) ;
99
- return $ocLazyLoad . load ( fileNames ) ;
99
+ return $ocLazyLoad . load ( moduleNames ) ;
100
100
}
101
101
}
102
102
Original file line number Diff line number Diff line change @@ -1251,7 +1251,7 @@ Styleguide 4.4
1251
1251
//
1252
1252
// sg-angular-directive:
1253
1253
// name: sgAppTest
1254
- // template : demo/testDirective.html
1254
+ // file : demo/testDirectiveInit.js
1255
1255
// file: demo/testDirective.js
1256
1256
//
1257
1257
// Styleguide 6.1
@@ -1262,11 +1262,23 @@ Styleguide 4.4
1262
1262
-webkit-user-select : none ;
1263
1263
-ms-user-select : none ;
1264
1264
padding : 0.2em ;
1265
- border : 1 px solid red ;
1265
+ border : 2 px solid red ;
1266
1266
display : initial ;
1267
1267
cursor : pointer ;
1268
1268
}
1269
1269
1270
+ // Test directive2
1271
+ //
1272
+ // markup:
1273
+ // <div sg-test-directive-two>If you see this something is wrong</div>
1274
+ //
1275
+ // sg-angular-directive:
1276
+ // name: sgAppTest
1277
+ // file: demo/testDirectiveInit.js
1278
+ // file: demo/testDirectiveTwo.js
1279
+ //
1280
+ // Styleguide 6.2
1281
+
1270
1282
// styleguide:ignore:start
1271
1283
@include styleguide_custom_styles ;
1272
1284
// styleguide:ignore:end
Original file line number Diff line number Diff line change 2
2
3
3
// Test directive is used to demo lazy loading external directive in the test project
4
4
5
- angular . module ( 'sgAppTest' , [ ] )
5
+ angular . module ( 'sgAppTest' )
6
6
. controller ( 'sgAppTest' , function ( $scope ) {
7
7
$scope . clickCount = 0 ;
8
8
$scope . incrementClicks = function ( ) {
Original file line number Diff line number Diff line change
1
+ angular . module ( 'sgAppTest' , [ ] ) ;
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ angular . module ( 'sgAppTest' )
4
+ . controller ( 'sgAppTest' , function ( $scope ) {
5
+ $scope . clickCount = 0 ;
6
+ $scope . incrementClicks = function ( ) {
7
+ $scope . clickCount += 1 ;
8
+ } ;
9
+ } )
10
+ . directive ( 'sgTestDirectiveTwo' , function ( ) {
11
+ return {
12
+ replace : true ,
13
+ restrict : 'A' ,
14
+ templateUrl : 'demo/testDirective.html'
15
+ } ;
16
+ } ) ;
Original file line number Diff line number Diff line change @@ -67,6 +67,24 @@ function emitCompileSuccess() {
67
67
}
68
68
}
69
69
70
+ function groupModuleFiles ( allModules ) {
71
+ // Group modules by module name
72
+ var namedModules = _ . groupBy ( allModules , function ( module ) {
73
+ return module . name ;
74
+ } ) ;
75
+
76
+ // Commbile files from every module that has the same name
77
+ return _ . map ( namedModules , function ( modules , moduleName ) {
78
+ var files = _ . uniq ( _ . reduce ( modules , function ( files , singleModule ) {
79
+ return files . concat ( singleModule . files ) ;
80
+ } , [ ] ) ) ;
81
+ return {
82
+ name : moduleName ,
83
+ files : files
84
+ } ;
85
+ } ) ;
86
+ }
87
+
70
88
function generateSectionWrapperMarkup ( json ) {
71
89
json . section = wrapperMarkup . generateSectionWrapperMarkup ( json . sections ) ;
72
90
}
@@ -291,7 +309,7 @@ module.exports.generate = function(options) {
291
309
styleguideConfig : JSON . stringify ( copyUsedOptionsToInlineJsonConfig ( opt , { } ) . config ) ,
292
310
appRoot : opt . appRoot ,
293
311
socketIo : opt . server ,
294
- filesConfig : JSON . stringify ( opt . filesConfig )
312
+ filesConfig : JSON . stringify ( groupModuleFiles ( opt . filesConfig ) )
295
313
} ) )
296
314
. pipe ( pushAllFiles ( ) )
297
315
. on ( 'finish' , resolve ) ;
You can’t perform that action at this time.
0 commit comments