Skip to content

Instantly share code, notes, and snippets.

@fchristant
fchristant / template.js
Created February 27, 2017 21:35
Template expressions
add() {
return `${this.a} + ${this.b} = ${this.a + this.b}`;
}
@fchristant
fchristant / silva-shorthand.js
Created February 27, 2017 21:07
Silva.JS shorthand
𝒮(() => {
console.log(app);
});
@fchristant
fchristant / silva-dom-client.js
Last active February 25, 2017 20:44
Silva.JS GoogleMap client-side
window.addEventListener('app.onReady',function() {
app.components.load("GoogleMap").then(function(GoogleMap) {
var newComp = document.createElement('div');
newComp.innerHTML = '<div class="c_google-map__map"></div>';
newComp.setAttribute('data-component','');
newComp.setAttribute('data-component-init','');
newComp.setAttribute('data-module','GoogleMap');
newComp.setAttribute('data-zoom','1');
newComp.setAttribute('id','map2');
newComp.classList += 'c_google-map';
@fchristant
fchristant / dragon.googlemap.js
Last active September 3, 2019 18:50
dragon.googlemap.js
dragon.ready().then(() => {
var myMap = dragon.components.googlemap.map1;
myMap.zoom = 1;
});
@fchristant
fchristant / silva-dom.html
Last active August 30, 2019 10:29
Silva.JS GoogleMap HTML
<div data-component data-component-init data-compoent-module="googlemap" data-lat="4.570868" data-lng="-74.297333" data-zoom="5" data-component-id="map3" class="c_google-map">
<div class="c_google-map__map"></div>
</div>