-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lazy loaded directive example to demo project. Use separate gulp …
…file for demo
- Loading branch information
Hannu Pelkonen
committed
Dec 4, 2014
1 parent
f296055
commit 8babc4b
Showing
6 changed files
with
83 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
var gulp = require('gulp'), | ||
styleguide = require('./lib/styleguide'), | ||
source = 'lib/app/**/*.scss', | ||
ouputPath = 'demo-output'; | ||
|
||
gulp.task('styleguide', ['static'], function() { | ||
return gulp.src(source) | ||
.pipe(styleguide({ | ||
title: 'SC5 Styleguide', | ||
server: true, | ||
rootPath: ouputPath, | ||
overviewPath: 'README.md', | ||
styleVariables: 'lib/app/sass/_styleguide_variables.scss', | ||
sass: { | ||
src: 'lib/app/sass/app.scss', | ||
includePaths: [ | ||
'node_modules/node-bourbon/assets/stylesheets', | ||
'node_modules/node-neat/assets/stylesheets' | ||
] | ||
}, | ||
filesConfig: [ | ||
{ | ||
name: 'sgAppTest', | ||
files: [ | ||
'demo/testDirective.js' | ||
], | ||
template: 'demo/testDirective.html' | ||
} | ||
] | ||
})) | ||
.pipe(gulp.dest(ouputPath)); | ||
}); | ||
|
||
gulp.task('static', function() { | ||
gulp.src(['lib/demo/**']) | ||
.pipe(gulp.dest(ouputPath + '/demo')); | ||
}); | ||
|
||
gulp.task('watch', ['styleguide'], function() { | ||
// Start watching changes and update styleguide whenever changes are detected | ||
gulp.watch(source, ['styleguide']); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Hello from test directive</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
// Test directive is used to demo lazy loading external directive in the test project | ||
|
||
angular.module('sgAppTest', []) | ||
.directive('sgTestDirective', function($rootScope, $window, $timeout) { | ||
return { | ||
replace: true, | ||
restrict: 'A', | ||
templateUrl: 'demo/testDirective.html' | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters