-
Notifications
You must be signed in to change notification settings - Fork 20
scaffold done, routes completed, views not working yet. #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
renegadellama
wants to merge
2
commits into
codefellows-seattle-javascript-401d15:master
Choose a base branch
from
renegadellama:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
This file contains hidden or 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,4 @@ | ||
MONGODB_URI='mongodb://localhost/cfgram-backend' | ||
NODE_ENV='testing' | ||
APP_SECRET='coolsecret' | ||
PORT=3000 |
This file contains hidden or 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,2 @@ | ||
node_modules | ||
build/ |
This file contains hidden or 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 hidden or 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,7 @@ | ||
'use strict'; | ||
|
||
module.exports = ['$logProvider', logConfig]; | ||
|
||
function logConfig($logProvider) { | ||
$logProvider.debugEnabled(__DEBUG__); | ||
}; |
This file contains hidden or 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,41 @@ | ||
'use strict'; | ||
module.exports = ['$stateProvider', '$urlRouterProvider', routerConfig]; | ||
|
||
function routerConfig($stateProvider, $urlRouterProvider) { | ||
$urlRouterProvider.when('', '/home'); | ||
$urlRouterProvider.when('/', '/join#signup'); | ||
$urlRouterProvider.when('/signup', '/join#signup'); | ||
$urlRouterProvider.when('/login', '/join#login'); | ||
|
||
let routes = [ | ||
{ | ||
name: 'home', | ||
url: '/home', | ||
template: require('../view/home/home.html'), | ||
controller: 'HomeController', | ||
controllerAs: 'homeCtrl', | ||
}, | ||
{ | ||
name: 'landing', | ||
url: '/join', | ||
template: require('../view/landing/landing.html'), | ||
controller: 'LandingController', | ||
controllerAs: 'landingCtrl' | ||
}, | ||
{ | ||
name: 'signup', | ||
url:'/signup', | ||
template: require('../view/signup/signup.html'), | ||
controller: 'SignupController', | ||
controllerAs: 'signupCtrl', | ||
}, | ||
{ | ||
name: 'login', | ||
url: '/login', | ||
template: require('../view/landing/landing.html'), | ||
controller: 'LoginController', | ||
controllerAs: 'loginCtrl' | ||
} | ||
]; | ||
routes.forEach($stateProvider.state); | ||
} |
This file contains hidden or 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,27 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const camelcase = require('camelcase'); | ||
const pascalcase = require('pascalcase'); | ||
const angular = require('angular'); | ||
const uiRouter = require('@uirouter/angularjs'); | ||
|
||
// require('./scss/main.scss'); | ||
|
||
const cfgram = angular.module('cfgram', ['ui.router']); | ||
|
||
let context = require.context('./config/', true, /\.js$/); | ||
context.keys().forEach(key => { | ||
cfgram.config(context(key)); | ||
}); | ||
|
||
context = require.context('./view/', true, /\.js$/); | ||
context.keys().forEach(key => { | ||
cfgram.controller(pascalcase(path.basename(key, '.js')), context(key)); | ||
}); | ||
|
||
ontext = require.context('./service/', true, /\.js$/); | ||
context.keys().forEach(key => cfgram.service(camelcase(path.basename(key, '.js')), context(key))); | ||
|
||
context = require.context('./component/', true, /\.js$/); | ||
context.keys().forEach(key => cfgram.component(camelcase(path.basename(key, '.js')), context(key))); |
This file contains hidden or 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 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title></title> | ||
</head> | ||
<body ng-app="routesApp"> | ||
<main> | ||
<ui-view></ui-view> | ||
</main> | ||
</body> | ||
</html> |
This file contains hidden or 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,48 @@ | ||
0 info it worked if it ends with ok | ||
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', | ||
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', | ||
1 verbose cli 'run', | ||
1 verbose cli 'test-watch' ] | ||
2 info using npm@3.10.10 | ||
3 info using node@v6.10.0 | ||
4 verbose run-script [ 'pretest-watch', 'test-watch', 'posttest-watch' ] | ||
5 info lifecycle 26-angular-routing@1.0.0~pretest-watch: 26-angular-routing@1.0.0 | ||
6 silly lifecycle 26-angular-routing@1.0.0~pretest-watch: no script for pretest-watch, continuing | ||
7 info lifecycle 26-angular-routing@1.0.0~test-watch: 26-angular-routing@1.0.0 | ||
8 verbose lifecycle 26-angular-routing@1.0.0~test-watch: unsafe-perm in lifecycle true | ||
9 verbose lifecycle 26-angular-routing@1.0.0~test-watch: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\Isak Swearingen\CodeFellows\401\lab_isak\26-angular-routing\node_modules\.bin;C:\Users\Isak Swearingen\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Isak Swearingen\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\PuTTY;C:\Users\Isak Swearingen\AppData\Local\atom\bin;C:\Users\Isak Swearingen\AppData\Local\Microsoft\WindowsApps;C:\Users\Isak Swearingen\AppData\Roaming\npm;C:\Program Files\Heroku\bin;C:\Program Files\MongoDB\Server\3.4\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl | ||
10 verbose lifecycle 26-angular-routing@1.0.0~test-watch: CWD: C:\Users\Isak Swearingen\CodeFellows\401\lab_isak\26-angular-routing | ||
11 silly lifecycle 26-angular-routing@1.0.0~test-watch: Args: [ '/d /s /c', 'karma' ] | ||
12 silly lifecycle 26-angular-routing@1.0.0~test-watch: Returned: code: 1 signal: null | ||
13 info lifecycle 26-angular-routing@1.0.0~test-watch: Failed to exec test-watch script | ||
14 verbose stack Error: 26-angular-routing@1.0.0 test-watch: `karma` | ||
14 verbose stack Exit status 1 | ||
14 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16) | ||
14 verbose stack at emitTwo (events.js:106:13) | ||
14 verbose stack at EventEmitter.emit (events.js:191:7) | ||
14 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14) | ||
14 verbose stack at emitTwo (events.js:106:13) | ||
14 verbose stack at ChildProcess.emit (events.js:191:7) | ||
14 verbose stack at maybeClose (internal/child_process.js:877:16) | ||
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) | ||
15 verbose pkgid 26-angular-routing@1.0.0 | ||
16 verbose cwd C:\Users\Isak Swearingen\CodeFellows\401\lab_isak\26-angular-routing\app | ||
17 error Windows_NT 10.0.14393 | ||
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test-watch" | ||
19 error node v6.10.0 | ||
20 error npm v3.10.10 | ||
21 error code ELIFECYCLE | ||
22 error 26-angular-routing@1.0.0 test-watch: `karma` | ||
22 error Exit status 1 | ||
23 error Failed at the 26-angular-routing@1.0.0 test-watch script 'karma'. | ||
23 error Make sure you have the latest version of node.js and npm installed. | ||
23 error If you do, this is most likely a problem with the 26-angular-routing package, | ||
23 error not with npm itself. | ||
23 error Tell the author that this fails on your system: | ||
23 error karma | ||
23 error You can get information on how to open an issue for this project with: | ||
23 error npm bugs 26-angular-routing | ||
23 error Or if that isn't available, you can get their info via: | ||
23 error npm owner ls 26-angular-routing | ||
23 error There is likely additional logging output above. | ||
24 verbose exit [ 1, true ] |
Empty file.
This file contains hidden or 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,94 @@ | ||
'use strict'; | ||
|
||
module.exports = [ | ||
'$q', | ||
'$log', | ||
'$http', | ||
'$window', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You also need to pass in authService in here |
||
function($q, $log, $http, $window, authService) { | ||
$log.debug('authService'); | ||
|
||
let service = {}; | ||
let token = null; | ||
|
||
function setToken(_token) { | ||
$log.debug('authService.setToken()'); | ||
|
||
if(!_token) return $q.reject(new Error('Token Does Not Exist')); | ||
$window.localStorage.setItem('token', _token); | ||
token = _token; | ||
|
||
return $q.resolve(token); | ||
} | ||
|
||
service.getToken = function() { | ||
$log.debug('authService.getToken()'); | ||
|
||
if(token) return $q.resolve(token); | ||
token = $window.localStorage.getItem('token'); | ||
if(token) return $q.resolve(token); | ||
|
||
return $q.reject(new Error('Token not found.')); | ||
}; | ||
|
||
service.logout = function() { | ||
$log.debug('authService.logout()'); | ||
|
||
$window.localStorage.removeItem('token'); | ||
token = null; | ||
|
||
return $q.resolve(); | ||
}; | ||
|
||
service.deleteToken = function() { | ||
$log.debug('authService.deleteToken()'); | ||
|
||
if(token) $window.localStorage.removeItem('token'); | ||
token = null; | ||
|
||
return $q.resolve(); | ||
}; | ||
|
||
service.signup = function(user) { | ||
$log.debug('authService.signup()'); | ||
|
||
let url = `${__API_URL__}/api/signup`; | ||
let config = { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'Accept': 'application/json' | ||
} | ||
}; | ||
|
||
return $http.post(url, user, config) | ||
.then(res => { | ||
$log.log('success', res.data); | ||
}) | ||
.catch(err => { | ||
$log.error('failure', err); | ||
}); | ||
}; | ||
|
||
service.signin = function(user) { | ||
$log.debug('authService.signin()'); | ||
|
||
let url = `${__API_URL__}/api/signin`; | ||
let config = { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'Accept': 'application/json' | ||
} | ||
}; | ||
|
||
return $http.get(url, user, config) | ||
.then(res => { | ||
$log.log('success', res.data); | ||
}) | ||
.catch(err => { | ||
$log.error('failure', err); | ||
}); | ||
}; | ||
|
||
return service; | ||
} | ||
]; |
This file contains hidden or 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,50 @@ | ||
const angular = require('angular'); | ||
require('angular-mocks'); | ||
|
||
describe('testing gallery controller', function(){ | ||
beforeEach(() => { | ||
angular.mock.module('routesApp'); | ||
angular.mock.inject(($rootScope, $controller) => { | ||
this.$rootScope = $rootScope; | ||
this.galleryCtrl = new $controller('GalleryController'); | ||
this.galleryCtrl.$onInit(); | ||
}); | ||
}); | ||
afterEach(() => this.$rootScope.$apply()); | ||
|
||
it('Should have text in the title', () => { | ||
expect(this.galleryCtrl.title).toBe.string; | ||
}); | ||
}); | ||
|
||
describe('testing signup controller', function(){ | ||
beforeEach(() => { | ||
angular.mock.module('routesApp'); | ||
angular.mock.inject(($rootScope, $controller) => { | ||
this.$rootScope = $rootScope; | ||
this.signupCtrl = new $controller('SignupController'); | ||
this.signupCtrl.$onInit(); | ||
}); | ||
}); | ||
afterEach(() => this.$rootScope.$apply()); | ||
|
||
it('Should have text in the title', () => { | ||
expect(this.signupCtrl.title).toBe.string; | ||
}); | ||
}); | ||
|
||
describe('testing home controller', function(){ | ||
beforeEach(() => { | ||
angular.mock.module('routesApp'); | ||
angular.mock.inject(($rootScope, $controller) => { | ||
this.$rootScope = $rootScope; | ||
this.homeCtrl = new $controller('HomeController'); | ||
this.homeCtrl.$onInit(); | ||
}); | ||
}); | ||
afterEach(() => this.$rootScope.$apply()); | ||
|
||
it('Should have text in the title', () => { | ||
expect(this.homeCtrl.title).toBe.string; | ||
}); | ||
}); |
This file contains hidden or 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,3 @@ | ||
section{ | ||
background-color: linear-gradient(#fff, #000, #444, #888); | ||
} |
This file contains hidden or 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,16 @@ | ||
'use strict'; | ||
|
||
require('./_home.scss'); | ||
|
||
module.exports = ['$log', function($log){ | ||
$log.debug('HomeController'); | ||
|
||
this.$onInit = () => { | ||
this.title = 'The Home Page, of Derf!!!'; | ||
|
||
// this.update = function(input) { | ||
// $log.debug('#updateHome'); | ||
// return this.say({text: input || 'Home', f: this.current}); | ||
// }; | ||
}; | ||
}]; |
This file contains hidden or 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,5 @@ | ||
<section> | ||
<h1>{{ homeCtrl.title }}</h1> | ||
<a href="/#!/signup">Sign Up</a> | ||
<a href="/#!/gallery">Gallery</a> | ||
</section> |
Empty file.
This file contains hidden or 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,10 @@ | ||
'use strict'; | ||
|
||
require('./_landing.scss'); | ||
|
||
module.exports = ['$log', '$location', '$rootScope', 'authService', LandingController]; | ||
|
||
function LandingController($log, $location, authService) { | ||
let url = $location.url(); | ||
this.showSignup = url === '/join#signup' || url === '/join'; | ||
} |
This file contains hidden or 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,25 @@ | ||
<section class="landing"> | ||
<div class="join-container" | ||
ng-if="landingCtrl.showSignup"> | ||
<div class="join-inner"> | ||
<signup></signup> | ||
<p>Already a member?</p> | ||
<a href="/#!login" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you'll need to add a '/' before the login. |
||
ng-click="landingCtrl.showSignup=false"> | ||
Sign In Here | ||
</a> | ||
</div> | ||
</div> | ||
|
||
<div class="join-container" | ||
ng-if="!landingCtrl.showSignup"> | ||
<div class="join-inner"> | ||
<login></login> | ||
<p>Want to Sign Up?</p> | ||
<a href="/#!/signup" | ||
ng-click="landingCtrl.showSignup=true"> | ||
Sign Up Here | ||
</a> | ||
</div> | ||
</div> | ||
</section> |
Empty file.
This file contains hidden or 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,16 @@ | ||
'use strict'; | ||
|
||
const angular = require('angular'); | ||
|
||
module.exports = ['$log', function($log) { | ||
$log.debug('SignupController'); | ||
|
||
this.$onInit = () => { | ||
this.title = 'Sign Up'; | ||
|
||
this.update = function(input) { | ||
$log.debug('#update'); | ||
return this.say({text: input || 'SignUp', f: this.current}); | ||
}; | ||
}; | ||
}]; |
This file contains hidden or 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,9 @@ | ||
<section> | ||
<h1>Sign Up</h1> | ||
<form> | ||
<label>Name: <input type="text" ng-model="signupCtrl.text"></label> | ||
<label>Email: <input type="text" ng-model="signupCtrl.email"></label> | ||
<label>Password: <input type="text" ng-model="signupCtrl.password"></label> | ||
|
||
</form> | ||
</section> |
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you always gitignore your .env files.