Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ChrisPerez/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/node_modules/*
**/vendor/*
**/*.min.js
**/build/*
**/test/*_bundle*
*.md
package.json
45 changes: 45 additions & 0 deletions ChrisPerez/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"rules": {
"no-console": 0,
"indent": [
2,
2,
{
"SwitchCase": 1
}
],
"quotes": [
2,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
]
},
"env": {
"es6": true,
"node": true,
"browser": true,
"mocha": true,
"jasmine": true
},
"globals": {
"describe": false,
"it": false,
"beforeEach": false,
"afterEach": false,
"before": false,
"after": false
},
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true,
"impliedStrict": true
},
"extends": "eslint:recommended"
}
106 changes: 106 additions & 0 deletions ChrisPerez/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

# Created by https://www.gitignore.io/api/node,osx,windows,vim

build/**

### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history


### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk


### Vim ###
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags
1 change: 1 addition & 0 deletions ChrisPerez/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ng boilerplate
Empty file added ChrisPerez/app/css/app.css
Empty file.
27 changes: 27 additions & 0 deletions ChrisPerez/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bunny Image App</title>
<link rel="stylesheet" href="app.css">
</head>

<body data-ng-app="FirstApp">

<main ng-cloak ng-controller="FirstController as bunny">

<first-directive title="{{bunny.title}}" description="{{bunny.description}}" url="{{bunny.url}}"></first-directive>
<second-directive url="{{bunny.url}}" description="{{bunny.description}}" width="{{bunny.width}}"></second-directive>
<third-directive url="{{bunny.url}}" description="{{bunny.description}}" width="{{bunny.width}}"></third-directive>




</main>
<script src="bundle.js"></script>
</body>

</html>
4 changes: 4 additions & 0 deletions ChrisPerez/app/js/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const angular = require('angular');

var FirstApp = angular.module('FirstApp', []);
require('./first')(FirstApp);
9 changes: 9 additions & 0 deletions ChrisPerez/app/js/first/controllers/FirstController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = function(app) {
app.controller('FirstController', ['$scope', function() {
this.url = 'http://f.cl.ly/items/3g3J1G0w122M360w380O/3726490195_f7cc75d377_o.jpg';
this.title = 'Bunny';
this.description = 'This is a picture of a bunny. Neat, right?';
this.height = 400;
this.width = 400;
}]);
};
3 changes: 3 additions & 0 deletions ChrisPerez/app/js/first/controllers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function(app) {
require('./FirstController')(app);
};
15 changes: 15 additions & 0 deletions ChrisPerez/app/js/first/directives/FirstDirective.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = function(app) {
app.directive('firstDirective', function() {
return {
templateUrl: './templates/FirstApp/FirstTemplate.html',
restrict: 'E',
// transclude: true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete comments

scope: {
title: '@',
description: '@',
url: '@'
}
};

});
};
18 changes: 18 additions & 0 deletions ChrisPerez/app/js/first/directives/SecondDirective.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = function(app) {
app.directive('secondDirective', function() {
return {
//template: '<h1>First Directive</h1>'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments

templateUrl: './templates/FirstApp/SecondTemplate.html',
restrict: 'E',
// transclude: true,
scope: {
title: '@',
description: '@',
url: '@',
height: '@',
width: '@'
}
};

});
};
18 changes: 18 additions & 0 deletions ChrisPerez/app/js/first/directives/ThirdDirective.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = function(app) {
app.directive('thirdDirective', function() {
return {
//template: '<h1>First Directive</h1>'
templateUrl: './templates/FirstApp/ThirdTemplate.html',
restrict: 'E',
// transclude: true,
scope: {
title: '@',
description: '@',
url: '@',
height: '@',
width: '@'
}
};

});
};
5 changes: 5 additions & 0 deletions ChrisPerez/app/js/first/directives/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = function(app) {
require('./FirstDirective')(app);
require('./SecondDirective')(app);
require('./ThirdDirective')(app);
};
4 changes: 4 additions & 0 deletions ChrisPerez/app/js/first/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = function(app) {
require('./controllers')(app);
require('./directives')(app);
};
3 changes: 3 additions & 0 deletions ChrisPerez/app/templates/FirstApp/FirstTemplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h1>Title: {{title}}</h1>
<h2>Description: {{description}}</h2>
<h3>Source: {{url}}</h3>
3 changes: 3 additions & 0 deletions ChrisPerez/app/templates/FirstApp/SecondTemplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
<img src="{{url}}" alt="{{description}}" title="{{title}}" width="100px" />
</div>
1 change: 1 addition & 0 deletions ChrisPerez/app/templates/FirstApp/ThirdTemplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<img src="{{url}}" alt="{{description}}" title="{{title}}" width="{{width}}px" />
56 changes: 56 additions & 0 deletions ChrisPerez/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
var gulp = require('gulp');
//var mocha = require('gulp-mocha');
var webpack = require('webpack-stream');
//var Karma = require('karma').Server;

gulp.task('webpack:dev', function() {
return gulp.src('./app/js/client.js')
.pipe(webpack({
output: {
filename: 'bundle.js'
}
}))
.pipe(gulp.dest('build/'));
});

// gulp.task('webpack:test', function() {
// return gulp.src('./test/client/entry.js')
// .pipe(webpack({
// output: {
// filename: 'test_bundle.js'
// }
// }))
// .pipe(gulp.dest('test/client'));
// });

gulp.task('staticfiles:dev', function() {
return gulp.src('./app/**/*.html')
.pipe(gulp.dest('build/'));
});

gulp.task('staticcssfiles:dev', function() {
return gulp.src('./app/css/*.css')
.pipe(gulp.dest('build/'));
});

// gulp.task('servertests', function() {
// return gulp.src('./test/api_test/**/*tests.js')
// .pipe(mocha({reporter: 'nyan'}))
// .once('error', function(err) {
// console.log(err);
// process.exit(1);
// })
// .once('end', function() {
// if (this.seq.length === 1 && this.seq[0] === 'servertests')
// process.exit();
// }.bind(this));
// });

// gulp.task('karmatests', ['webpack:test'], function(done) {
// new Karma({
// configFile: __dirname + '/karma.conf.js'
// }, done).start();
// });

gulp.task('build:dev', ['staticfiles:dev','staticcssfiles:dev', 'webpack:dev']);
gulp.task('default', ['build:dev']);
17 changes: 17 additions & 0 deletions ChrisPerez/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "ng-adventure",
"version": "1.0.0",
"description": "ng boilerplate",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"webpack-stream": "^3.2.0"
},
"dependencies": {
"angular": "^1.5.7"
}
}
7 changes: 7 additions & 0 deletions ChrisPerez/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/build'));
var server = app.listen(3003, function(){
console.log('server is running at %s', server.address().port);
});