diff --git a/unit_03/w08d02/homework/cipher_solution/app.js b/unit_03/w08d02/homework/instr_cipher_solution/app.js similarity index 100% rename from unit_03/w08d02/homework/cipher_solution/app.js rename to unit_03/w08d02/homework/instr_cipher_solution/app.js diff --git a/unit_03/w08d02/homework/cipher_solution/caesarcipher.js b/unit_03/w08d02/homework/instr_cipher_solution/caesarcipher.js similarity index 100% rename from unit_03/w08d02/homework/cipher_solution/caesarcipher.js rename to unit_03/w08d02/homework/instr_cipher_solution/caesarcipher.js diff --git a/unit_03/w08d02/homework/cipher_solution/index.html b/unit_03/w08d02/homework/instr_cipher_solution/index.html similarity index 100% rename from unit_03/w08d02/homework/cipher_solution/index.html rename to unit_03/w08d02/homework/instr_cipher_solution/index.html diff --git a/unit_03/w08d02/homework/cipher_solution/style.css b/unit_03/w08d02/homework/instr_cipher_solution/style.css similarity index 100% rename from unit_03/w08d02/homework/cipher_solution/style.css rename to unit_03/w08d02/homework/instr_cipher_solution/style.css diff --git a/unit_03/w08d02/homework/songs_solution/app2.js b/unit_03/w08d02/homework/instr_songs_solution/app2.js similarity index 100% rename from unit_03/w08d02/homework/songs_solution/app2.js rename to unit_03/w08d02/homework/instr_songs_solution/app2.js diff --git a/unit_03/w08d02/homework/songs_solution/index2.html b/unit_03/w08d02/homework/instr_songs_solution/index2.html similarity index 100% rename from unit_03/w08d02/homework/songs_solution/index2.html rename to unit_03/w08d02/homework/instr_songs_solution/index2.html diff --git a/unit_03/w08d02/homework/songs_solution/style.css b/unit_03/w08d02/homework/instr_songs_solution/style.css similarity index 100% rename from unit_03/w08d02/homework/songs_solution/style.css rename to unit_03/w08d02/homework/instr_songs_solution/style.css diff --git a/unit_03/w08d03/homework/angular_http_mongo/readme.md b/unit_03/w08d03/homework/angular_http_mongo/readme.md index e31d3eb..5b45fe7 100644 --- a/unit_03/w08d03/homework/angular_http_mongo/readme.md +++ b/unit_03/w08d03/homework/angular_http_mongo/readme.md @@ -66,7 +66,8 @@ Number of records and search/filter box #### Set up and seed db * `npm install` your dependencies. -* You have a seed route within a seed controller. Seed your database with all the World Bank records by going to `/seed` in your browser **once**. +* If you run `nodemon` and go to localhost, you should get a 'cannot GET /' in the browser. This is because there is not yet a public folder or anything attributed to the root. You can check out a JSON service routes by going to `/wbinfo/count`. This route gives a count of all records in the database, and should currently read 0 because the database has not been seeded. +* You have a seed route within a seed controller. Seed your database with all the World Bank records by going to `/seed` in your browser **once**. The app will redirect to the `wbinfo` JSON index for verification purposes.
{{ user.name }}
-Age: {{ user.age }}
-Female
-Male
-{{ user.name }}
-Age: {{ user.age }}
-Female
-Male
-ADD A DATER
- - -{{ user.name }}
-Age: {{ user.age }}
-Female
-Male
-{{ user.name }}
-Age: {{ user.age }}
-Female
-Male
-EDIT
- - - -match \ No newline at end of file diff --git a/unit_03/w08d04/homework/dating_app_routing_form/public/partials/new_user.html b/unit_03/w08d04/homework/dating_app_routing_form/public/partials/new_user.html deleted file mode 100644 index fa79528..0000000 --- a/unit_03/w08d04/homework/dating_app_routing_form/public/partials/new_user.html +++ /dev/null @@ -1,9 +0,0 @@ -ADD A DATER
- - \ No newline at end of file diff --git a/unit_03/w08d04/homework/dating_app_routing_match/controllers/usersController.js b/unit_03/w08d04/homework/dating_app_routing_match/controllers/usersController.js deleted file mode 100644 index 38fbdd6..0000000 --- a/unit_03/w08d04/homework/dating_app_routing_match/controllers/usersController.js +++ /dev/null @@ -1,39 +0,0 @@ -var express = require('express'), - router = express.Router(); - -var User = require('../models/users'); - - -router.get('/', function(req, res) { - User.find(function(err, user) { - res.send(user); - }); -}); - - -router.post('/', function(req, res) { - User.create(req.body, function(err, user) { - res.send(user); - }); -}); - -router.get('/seed', function(req, res) { - - var users = [ - { name: 'Ryan Gosling', age: 35, gender: 'm', img: 'http://coolspotters.com/files/photos/591533/ryan-gosling-large.jpg?1357449177'}, - { name: 'Hypatia of Alexandria', age: 1700, gender: 'f', img: 'http://static1.squarespace.com/static/53e031f1e4b088c3aac80e47/t/5636ebf1e4b0683b6c56cb43/1446440030277/hypatia.jpg'}, - { name: "Hogan", age: 40, gender: 'm', img: 'http://myfivebest.com/wp-content/uploads/2010/10/crime_crane.jpg'}, - { name: 'Lumpy Space Princess', age: 29, gender: 'f', img: 'http://t14.deviantart.net/PKE6w6_Z5VgPYF2_eiG8FOL2tEU=/fit-in/150x150/filters:no_upscale():origin()/pre14/9e4c/th/pre/f/2012/235/a/b/lumpy_space_princess_by_pikurosonai00-d5c72wn.png'}, - { name: 'Idris Elba', age: 43, gender: 'm', img: 'http://www.ramascreen.com/wp-content/uploads/2015/01/Idris-Elba-Luther-150x150.jpg'}, - { name: 'The Trash Heap of Fraggle Rock', age: 1000, gender: 'f', img: 'http://www.toughpigs.com/wp-content/uploads/2009/12/trasheap-150x150.jpg'}, - { name: 'Homeless guy', age: 60, gender: 'm', img: 'http://www.viralviralvideos.com/wp-content/uploads/2015/07/homeless-man-who-beautifully-pla-150x150.jpg'}, - { name: 'Raisin', age: 20, gender: 'f', img: 'http://cdn.lifeinthefastlane.com/wp-content/uploads/2010/09/raisin.jpg'} - ]; - - User.create(users, function(err, users) { - res.redirect('/'); - }); - -}); - -module.exports = router; \ No newline at end of file diff --git a/unit_03/w08d04/homework/dating_app_routing_match/public/app.js b/unit_03/w08d04/homework/dating_app_routing_match/public/app.js deleted file mode 100644 index 5db067f..0000000 --- a/unit_03/w08d04/homework/dating_app_routing_match/public/app.js +++ /dev/null @@ -1,136 +0,0 @@ -var app = angular.module('date', ['ngRoute']); - -app.controller('MainController', ['$http', '$scope', function($http, $scope) { - - var self = this; - - // gets all the users for display - this.getUsers = function() { - console.log('getUsers'); - - $http({ - url: '/users', - method: 'GET' - }).then(function(response) { - - // shuffles the users into arrays of 'even' and 'odd' - // in the index.html, odds will be populated on the left side of the page - // in the index.html, evens will go to the right side of the page - self.usersEven = []; - self.usersOdd = []; - - var shuffledData = shuffle(response.data); - - for (var i=0; i < response.data.length; i++) { - if (i % 2 == 0) { - self.usersEven.push(shuffledData[i]); - } else { - self.usersOdd.push(shuffledData[i]); - } - } // end for loop - }); // end ajax - }; // end getUsers - - // invoke getUsers on page load - this.getUsers(); - - // on ng-mouseover in left box, this function will display the moused-over user in the match box - this.displayImageL = function(img) { - $scope.$broadcast('leftImage', img); - } // end displayImageL - - // on ng-mouseover in right box, this function will display the moused-over user in the match box - this.displayImageR = function(img) { - $scope.$broadcast('rightImage', img); - } // end displayImageR - - // when the 'add a dater' form is submitted, all the ng-models in the form are placed into this.formdata. - // this.formdata is sent in the body of a POST request to create a new dater. - this.processForm = function() { - console.log('processForm'); - console.log('Formdata: ', this.formdata); - - $http({ - method: 'POST', - url: '/users', - data: this.formdata - }).then(function(result) { - self.getUsers(); - }); - } // end processForm - -}]); // end MainController - - - - -app.controller('MatchController', ['$scope', function($scope) { - console.log('match controller'); - - var self = this; - - // default images for the Match Box - this.limage="http://www.clker.com/cliparts/F/g/8/N/k/X/black-question-mark-square-icon-md.png"; - this.rimage="http://www.clker.com/cliparts/F/g/8/N/k/X/black-question-mark-square-icon-md.png"; - - $scope.$on('leftImage', function(event, data) { - console.log(data); - self.left = true; - self.limage = data; - }); - - $scope.$on('rightImage', function(event, data) { - console.log(data); - self.right = true; - self.rimage = data; - }); - - // when the 'click to match' button is pressed, this function will revert the display to default - this.match = function() { - this.limage="http://www.clker.com/cliparts/F/g/8/N/k/X/black-question-mark-square-icon-md.png"; - this.rimage="http://www.clker.com/cliparts/F/g/8/N/k/X/black-question-mark-square-icon-md.png"; - this.left = false; - this.right = false; - console.log('match'); - } // end match - -}]); - - -app.controller('EditController', [function() { - console.log('edit controller'); -}]); - - -app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { - - $locationProvider.html5Mode({ enabled: true }); - - $routeProvider.when('/edit/:id', { - templateUrl: 'partials/edit.html', - controller: 'EditController', - controllerAs: 'ctrl' - }); - - $routeProvider.when('/', { - templateUrl: 'partials/match.html', - controller: 'MatchController', - controllerAs: 'ctrl' - }); - -}]); // end Config - - -function shuffle(array) { - var counter = array.length; - while (counter > 0) { - var index = Math.floor(Math.random() * counter); - counter--; - var temp = array[counter]; - array[counter] = array[index]; - array[index] = temp; - } - return array; -} - - diff --git a/unit_03/w08d04/homework/dating_app_routing_match/public/index.html b/unit_03/w08d04/homework/dating_app_routing_match/public/index.html deleted file mode 100644 index f09b049..0000000 --- a/unit_03/w08d04/homework/dating_app_routing_match/public/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -{{ user.name }}
-Age: {{ user.age }}
-Female
-Male
-{{ user.name }}
-Age: {{ user.age }}
-Female
-Male
-ADD A DATER
- - -{{ user.name }}
-Age: {{ user.age }}
-Female
-Male
-{{ user.name }}
-Age: {{ user.age }}
-Female
-Male
-ADD A DATER
- - -{{ user.name }}
+Age: {{ user.age }}
+Female
+Male
+{{ user.name }}
+Age: {{ user.age }}
+Female
+Male
+ADD A DATER
+ + +EDIT {{ ctrl.user.name }}
+ + +