Created
February 20, 2014 20:23
-
-
Save takempf/9122430 to your computer and use it in GitHub Desktop.
Use browserify + hbsfy to render solidus widgets client side
This file contains hidden or 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
| var $ = require('jquery'); | |
| // Set up hbsfy for Solidus feature parity | |
| var Handlebars = require('hbsfy/runtime'); | |
| // Pull in Handlebars helpers | |
| var HandlebarsHelper = require('handlebars-helper'); | |
| HandlebarsHelper.help( Handlebars ); | |
| // Set partials | |
| Handlebars.registerPartial( 'favorite', require('../../views/favorite.hbs') ); | |
| var favorites_template = require('../../views/favorites.hbs'); | |
| $(function(){ | |
| $('body').append( favorites_template( solidus.context.resources.favorites ) ); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment