Skip to content

Instantly share code, notes, and snippets.

View bdavidxyz's full-sized avatar
🏠
Working from home

David Boureau bdavidxyz

🏠
Working from home
View GitHub Profile
function labeledCheckboxes (proposals, answers) {
// check pre-conditions
if (_(proposals).isEmpty()) return [];
if !(_(proposals).isArray && _.every(proposals, _.isString)) return [];
if !(_(proposals).isArray && _.every(proposals, _.isBoolean)) return [];
if (_(answers).size() > _(proposals).size()) return [];
// etc
if (_(proposals).isEmpty()) return [];
if (_(proposals).isNotArrayOfString()) return [];
if (_(answers).isNotArrayOfBoolean()) return [];
if (_(answers).size() > _(proposals).size()) return [];
import Ember from 'ember';
export default Ember.Component.extend({
answersDidChange: Ember.on('init', Ember.observer('answers', function() {
// some side effect of salutation changing
console.log('answers changed to ' + this.get('answers'));
})),
didInsertElement: function() {
console.log('answers ' + this.get('answers'));
let array = JSON.parse(this.get('answers'));
<!DOCTYPE html>
<html>
<head>
<title>Ruban</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="bower_components/normalize-css/normalize.css" />
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="bower_components/highlightjs/styles/tomorrow.css" />
<link rel="stylesheet" href="bower_components/ruban/css/ruban.min.css" />
<link rel="stylesheet" href="bower_components/ruban/css/ruban-print.min.css" media="print" />