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
create = { | |
handler: function(request, reply) { | |
return new Address().save({ | |
name: request.payload.name, | |
address_line1: request.payload.address_line1 | |
}) | |
.call('fetch') | |
.then(reply) | |
.catch(reply); | |
} |
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'; | |
var DB = require('./db'); | |
var Joi = require('joi'); | |
var Promise = require('bluebird'); | |
var _ = require('lodash'); | |
var Model = DB.Model.extend({ | |
constructor: function () { | |
DB.Model.apply(this, arguments); |
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
toJSON: -> | |
json = super | |
json.status = json.status.name | |
json |
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 sinon = require('sinon'); | |
var Promise = require('bookshelf/dialects/base/promise').Promise; | |
var Bookshelf = require('bookshelf'); | |
var unhandled = sinon.spy(); | |
var caught = sinon.spy(); | |
Promise.onPossiblyUnhandledRejection(unhandled); |
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('quizApp') | |
.factory('Question', function () { | |
var Question = function (question, answers, correct_answer) { | |
this.question = question; | |
this.answers = []; | |
this.correct_answer = correct_answer; | |
}; |
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
<div ng-repeat="answer in question.answers"> | |
<input type="text" ng-model="answer.text" /> | |
<input type="checkbox" ng-model="answer.correct" /> | |
</div> | |
<!-- --> | |
<answer ng-repeat="answer in answers" answer-model="answer"></answer> |
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
<!-- Most Abstract --> | |
<quiz quiz="quiz"></quiz> | |
<!-- 2 --> | |
<form class="quiz"> | |
<h1>{{quiz.title}}</h1> | |
<question-set questions="quiz.questions"></question-set> | |
</form> |
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 LibraryCtor = function () { | |
}; | |
var libraryFactory = function (config) { | |
return new LibraryCtor(config); | |
}; | |
libraryFactory.LibraryCtor = LibraryCtor; |
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 count = 0; | |
count++; | |
module.exports = count; |
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
.config( function ($stateProvider) { | |
$stateProvider | |
.state('post', { | |
url: '/posts', | |
template: '<ui-view />', | |
abstract: true | |
}) | |
.state('post.create', { | |
url: '/create', | |
templateUrl: '/views/post/create.html', |