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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
'use strict'; | |
angular.module('offcampustest', ['ngRoute', 'ngResource', 'angularFileUpload']) | |
.config(function($routeProvider, $locationProvider) { | |
$routeProvider | |
.when('/', { | |
templateUrl:'/templates/rentals.html', | |
controller: 'RentalsCtrl' | |
} | |
) |
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
// web.js | |
var express = require("express"); | |
var logfmt = require("logfmt"); | |
var app = express(); | |
app.use(logfmt.requestLogger()); | |
app.get('/', function(req, res) { | |
res.send('Hello World!'); | |
}); |
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
'use strict'; | |
angular.module('weatherBetterApp', [ | |
'ngCookies', | |
'ngResource', | |
'ngSanitize', | |
'ngRoute' | |
]) | |
.config(function ($routeProvider) { | |
$routeProvider |
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
angular.module('myApp.directives', []) | |
.directive('checkboxLimit', function() { | |
return { | |
restrict: 'A', | |
link: function(scope, ele, attrs, ctrl) { | |
scope.$watch('bet.winner', function(newVal, oldVal) { | |
var bets = angular.element(document.getElementsByClassName('currentBet')); | |
console.log(newVal); | |
if (newVal === true) { | |
angular.forEach(bets, function(bet) { |
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
angular.module('myApp.directives', []) | |
.directive('checkboxLimit', function() { | |
return { | |
restrict: 'A', | |
replace: true, | |
link: function(scope, ele, attrs, ctrl) { | |
console.log(ele); | |
scope.inputDisabled = false; | |
scope.$watch('bet.winner', function(newVal, oldVal) { | |
var bets = angular.element(document.getElementsByClassName('currentBet')); |
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
angular.module('myApp.controllers', ['firebase']) | |
.controller('BettingController', ["$scope", "$firebase", function($scope, $firebase) { | |
var fireBase = new Firebase("https://flowbetter.firebaseio.com"); | |
$scope.bets = $firebase(fireBase); | |
$scope.newBet = { | |
better: "", | |
startTime: "", | |
lengthTime: "", | |
winner: false |
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
var app = angular.module('myApp', [ | |
'ngRoute', | |
'myApp.services', | |
'myApp.directives', | |
'myApp.filters', | |
'myApp.controllers', | |
'firebase' | |
]); |
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
'use strict'; | |
// Declare app level module which depends on filters, and services | |
angular.module('myApp', [ | |
'ngRoute', | |
'myApp.filters', | |
'myApp.services', | |
'myApp.directives', | |
'myApp.controllers' |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>Richard Dolan Press</title> |