Skip to content

Instantly share code, notes, and snippets.

// request to "/"
<body>
<div id="app-placeholder">
<header>Index Page</header>
<article>
Some Content
</article>
</div>
<script>
window.bootstrap = {
module.exports = function ( sandbox ) {
var Hotel = sandbox.mvc.Model.extend( { urlRoot : "/hotels" } );
return sandbox.mvc.App.extend( {
$el: sandbox.context.element,
constructor: function () {
this.hotel = new Hotel();
import {Inject} from 'di/annotations';
import Http from 'http';
import Dom from 'dom';
@Inject(Http)
export class Gallery {
constructor (http: Http) {
this.http = http;
}
run ({$el: Dom}) {
// request to "/"
<body>
<div id="app-placeholder">
<header>Index Page</header>
<article>
Some Content
</article>
</div>
<script src="app.js"></script>
</body>
// returned on request to any route
<body>
<div id="app-placeholder"></div>
<script src="app.js"></script>
</body>
var dom = require('jQuery');
var http = { get: dom.get };
var Gallery = require('gallery');
client.get('/', function () {
var scope = {
isServer: false,
$el: dom('#gallery-placeholder')
};
Gallery[Gallery.length - 1](http, scope);
CSSSelect('.products', $ul);
{
"type": "tag",
"name": "ul",
"attribs": { class: 'products' },
"children": [],
"next": null,
"prev": null,
"parent": null