Instantly share code, notes, and snippets.

View testChangeData.js
export default class extends Component {
state = { data: fakeData.slice(0, 10)}
onClick = () => {
this.setState({ data: fakeData.slice(10, 20)})
}
render() {
return (
<div>
View gist:d7fa52911b3b6f87fa03
<div id="griddle-external-simulated"></div>
<script type="text/jsx">
var externalData = fakeData.slice(0, 53);
var SimulatedExternalComponent = React.createClass({
getInitialState: function(){
var initial = { "results": [],
"currentPage": 0,
"maxPages": 0,
View WebpackOutput.js
var Test =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
View app.js
var foodApp = angular.module('foodApp', ['ngResource']);
foodApp.factory('Food', ['$resource', function($resource){
return $resource('/food/:id', {id:'@id'}, { update: {method:'PUT' } } );
}]);
foodApp.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/food', {templateUrl: '/templates/list.html', controller: FoodController})
.when('/food/edit/:id', {templateUrl: '/templates/edit.html', controller: FoodController})
View index.ejs
<h1 id="header">
Food Inventory
</h1>
<div id="content" ng-controller="FoodController">
<div class="filter">
<label for="filter">filter:</label>
<input type="text" name="filter" ng-model="filter" />
</div>
<table>
<thead>
View Food.js
/*---------------------
:: Food
-> model
---------------------*/
module.exports = {
attributes : {
name: 'STRING',
type: 'STRING',
expiration: 'DATE',
quantity: 'STRING',