Skip to content

Instantly share code, notes, and snippets.

<!-- HEADER AND TODO COUNT -->
<div class="jumbotron text-center">
<h1>RSVP Here<span class="label label-info"></span></h1>
</div>
<!-- FORM TO CREATE TODOS -->
<div id="rsvp-form" class="row">
<div class="col-sm-8 col-sm-offset-2 text-center">
<form>
<div class="form-group">
@mekhami
mekhami / app.js
Last active February 27, 2016 19:27
angular.module('myApp', [])
.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider.
when('/', {
templateUrl: '../views/codeform.html',
controller: 'MainController'
}).
when('/confirm/:code', {
templateUrl: '../views/confirm.html',
controller: 'ConfirmController'
<html>
<head>
<!-- META -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"><!-- Optimize mobile viewport -->
<title>Node/Angular Todo App</title>
<!-- SCROLLS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"><!-- load bootstrap -->
<div id="confirm-form" class="row">
<div class="col-sm-8 col-sm-offset-2 text-center">
<form>
<div class="form-group">
<!-- BIND THIS VALUE TO formData.text IN ANGULAR -->
<input type="text" class="form-control input-lg text-center" placeholder="Enter your full name" ng-model="formData.name" ng-value="rsvp.name">
<input type="text" class="form-control input-lg text-center" placeholder="Enter your Email address" ng-model="formData.email" value="{{ rsvp.email }}">
<h3>Attending?</h3>
<label>True
<div id="confirm-form" class="row">
<div class="col-sm-8 col-sm-offset-2 text-center">
<form>
<div class="form-group">
<!-- BIND THIS VALUE TO formData.text IN ANGULAR -->
<input type="text" class="form-control input-lg text-center" placeholder="Enter your full name" ng-model="formData.name" ng-value="rsvp.name">
<h4>{{rsvp.email}}</h4>
<input type="text" class="form-control input-lg text-center" placeholder="Enter your Email address" ng-model="formData.email" value="{{ rsvp.email }}">
<h3>Attending?</h3>
@mekhami
mekhami / app.js
Last active February 27, 2016 19:27
var myApp = angular.module('myApp', ['ngRoute']);
myApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider.
when('/', {
templateUrl: '../views/codeform.html',
controller: 'MainController',
access: {restricted: false}
}).
when('/confirm/:code', {
var myApp = angular.module('myApp', ['ngRoute']);
myApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider.
when('/', {
templateUrl: '../views/codeform.html',
controller: 'MainController',
access: {restricted: false}
}).
when('/confirm/:code', {
var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var User = require('../models/user.js');
var passport = require('passport');
router.post('/register', function(req, res) {
User.register(new User({ username: req.body.username}), req.body.password, function(err, account) {
if (err) {
return res.status(500).json({err:err});
<table class="table table-striped">
<tr>
<th>Name</th>
<th>Email</th>
<th>Attending</th>
<th>Allowed Extras</th>
<th>RSVP'd Extras</th>
</tr>
<div ng-repeat="person in rsvplist">
<tr>
.controller('AdminController', ['$scope', '$location', 'rsvpDataService', function($scope, $location, rsvpDS) {
$scope.rsvplist = [];
$scope.status;
getRsvpList();
function getRsvpList() {
rsvpDS.getAllRsvp()
.success(function(rsvps) {
angular.extend($scope.rsvplist, rsvps);