The simple app
object defining routes and "life cycle" like functions.
Forked from Heydon's Pen Just add javascript.
Handlebars.registerHelper('slugify', function(title) { | |
return title.toLowerCase() | |
.replace(/ /g,'-') | |
.replace(/[^\w-]+/g,''); | |
}); |
var Storage = (function (name) { | |
if (supportLocalStorage) { | |
var self = window['localStorage']; | |
if (!localStorage[name]) { | |
localStorage.ApplicationStorage = localStorage[name]; | |
localStorage.ApplicationStorage.users = localStorage.setItem('ApplicationStorage', 'Users'); |
define(function () { | |
'use strict'; | |
function BaseModel(title) { | |
this.title = title; | |
} | |
BaseModel.prototype = { |
define(function () { | |
'use strict'; | |
function BaseController(id) { | |
this.id = id; | |
} | |
BaseController.prototype = { |
define([ | |
'jquery' | |
], | |
function (requirejs) { | |
'use strict'; | |
var $ = requirejs('jquery'), | |
lib = requirejs('lib'), | |
controller = requirejs('UserController'), |
export default class Application { | |
constructor(container) { | |
this[container] = container; | |
} | |
init() { |
Pen exploring several topics: (1) How to build a scrollable, bootstrap style data grid; (2) How to virtualize the requisite components (2) using ES6 classes; (3) How to handle AJAX using an ES6 promise (instead of jQuery); and (4) How to make each class testable (or compatible with) using jsTestDriver.
Forked from brady house's Pen ES6 - Scrollable Datagrid.