Created
October 25, 2013 17:00
-
-
Save CharlotteGore/7158057 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in app initialisation | |
var views = new HyperboneView() | |
.registerHelper('parser', require('marked')) | |
.registerHelper('date', require('date-formating-module')); | |
// test data.. | |
var html = dom('<div>{{ parser( ProductDescription )}}</div>'); | |
var model = new HyperboneModel({ ProductDescription : "__hello world__" }); | |
// done automatically in a route handler... | |
views.createView( model, html ); | |
parser( ProductDescription )-> | |
parser( get("ProductDescription") ) -> p | |
parser( "__hello world__" ) -> | |
"<p><strong>hello world</strong></p>" -> | |
<div><p><strong>hello world</strong></p></strong> | |
model.set("ProductDescription", "lol") -> | |
<div><p>lol</p></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment