Skip to content

Commit 9602cee

Browse files
DBSQADBSQA
authored andcommitted
Initial commit after coverting to es6
0 parents  commit 9602cee

35 files changed

+1863
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "app/bower_components"
3+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/*
2+
app/bower_components/*
3+
app/dist/*
4+
.idea/*

.jshintrc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"node": true,
3+
"browser": true,
4+
"esnext": true,
5+
"bitwise": true,
6+
"camelcase": false,
7+
"curly": true,
8+
"eqeqeq": true,
9+
"immed": true,
10+
"indent": 2,
11+
"latedef": "nofunc",
12+
"newcap": true,
13+
"noarg": true,
14+
"quotmark": false,
15+
"regexp": true,
16+
"undef": true,
17+
"unused": true,
18+
"strict": true,
19+
"trailing": true,
20+
"smarttabs": true,
21+
"browserify" : true,
22+
"globals": {
23+
"angular": false,
24+
"_": false,
25+
"it": false,
26+
"xit": false,
27+
"describe": false,
28+
"xdescribe": false,
29+
"beforeEach": false,
30+
"browser": false,
31+
"expect": false,
32+
"spyOn" : false,
33+
"jasmine" : false
34+
}
35+
}

Gulpfile.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
var gulp = require('gulp');
2+
var sourcemaps = require('gulp-sourcemaps');
3+
var traceur = require('gulp-traceur');
4+
var concat = require('gulp-concat');
5+
var connect = require("gulp-connect");
6+
var jshint = require('gulp-jshint');
7+
8+
var SOURCE_FILES = ['!app/**/*_test.js', 'app/*.js', 'app/modules/**/*.js'];
9+
10+
// Runs JSHint Report against all JS files in app
11+
gulp.task('lint', function () {
12+
return gulp.src(SOURCE_FILES)
13+
.pipe(jshint())
14+
.pipe(jshint.reporter('jshint-stylish'))
15+
.pipe(jshint.reporter('fail'));
16+
});
17+
18+
gulp.task('watch', function () {
19+
20+
// Lint the JS files when they change
21+
gulp.watch(SOURCE_FILES, ['lint', 'traceur']);
22+
});
23+
24+
/* Sourcemaps seem to not be working when a base is specified */
25+
gulp.task('traceur', function () {
26+
return gulp.src(['!app/**/*_test.js', 'app/*.js', 'app/modules/**/*.js'], {base: './app'})
27+
//.pipe(sourcemaps.init())
28+
.pipe(traceur({
29+
modules: 'register',
30+
moduleName : true
31+
}))
32+
.pipe(concat('bundle.js'))
33+
//.pipe(sourcemaps.write())
34+
.pipe(gulp.dest('app/dist'));
35+
});
36+
37+
gulp.task('connect', function () {
38+
39+
// Uses gulp-connect plugin to start up a server
40+
connect.server({
41+
root: ['app'],
42+
port: 9000
43+
});
44+
});
45+
46+
gulp.task('default', ['traceur', 'lint', 'watch', 'connect']);

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
DigiBankDevTool
2+
===============
3+
4+
Seed project using Angular and all ES6 syntax (especially modules)
5+
6+
Uses:
7+
8+
* Angular
9+
* Angular UI Router
10+
* Traceur
11+
* Bootstrap
12+
* Gulp
13+
* Karma
14+
* Jasmine
15+
16+
17+
To run app:
18+
19+
* Clone repo
20+
* Install Gulp globally using `npm install gulp -g`
21+
* Run `npm install` from project root
22+
* Run `bower install` from project root
23+
* Run `gulp` from the project root
24+
* Navigate to localhost:9000
25+

app/app.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import homeModule from './modules/home/home';
2+
import Config from './config';
3+
4+
var appModule = angular.module("DigiBankDevTool", ["ui.router", homeModule.name]);
5+
6+
appModule.config(Config);
7+

app/config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
class Config {
3+
4+
constructor($stateProvider, $urlRouterProvider){
5+
6+
// For any unmatched url, redirect to /home
7+
$urlRouterProvider.otherwise("/home");
8+
9+
$stateProvider
10+
.state('home', {
11+
url: "/home",
12+
controller : "HomeCtrl as homeCtrl",
13+
templateUrl: "modules/home/home.html"
14+
})
15+
.state('details', {
16+
url: "/details",
17+
controller : "DetailsCtrl as detailsCtrl",
18+
templateUrl: "modules/home/details.html"
19+
});
20+
21+
}
22+
23+
}
24+
25+
Config.$inject = ['$stateProvider', '$urlRouterProvider'];
26+
27+
export default Config;

app/css/app.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
padding:15px;
3+
}

app/index.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Angular ES6 Seed</title>
6+
7+
<!-- Bootstrap -->
8+
<link href="bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
9+
<link href="css/app.css" rel="stylesheet">
10+
11+
</head>
12+
<body ng-app="DigiBankDevTool">
13+
14+
<section class="main-content">
15+
<ui-view></ui-view>
16+
</section>
17+
18+
<script src="https://google.github.io/traceur-compiler/bin/traceur.js"></script>
19+
<script src="bower_components/angular/angular.js"></script>
20+
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
21+
<script src="dist/bundle.js"></script>
22+
<script>
23+
System.get("app");
24+
</script>
25+
26+
</body>
27+
</html>

0 commit comments

Comments
 (0)