Connect with:
About Me
Alessandro Annini
I'm a freelance developer currently working at I really love framework and its amazing potential and if you're like me, and you want the web to win, please share some snippet of code for the community and grow faster with us
Meta Code | Using a widget inside a fiddle

Using a widget inside a fiddle

02 Jul Using a widget inside a fiddle

Thanks to Talves we discovered how simply is to use a widget/component right inside our fiddle:

  1. copy the hole widget code after your code;
  2. give it a name different from ‘main‘;
  3. call it with a simple require, like this:

define('main',function(require, exports, module) {
    var Engine = require('famous/core/Engine');
    var Modifier = require('famous/core/Modifier');
	// load our widget
    var Widget1 = require('widgetOne');
	// use it!
	var widget = new Widget1();
	// CODE

define('widgetOne',function(require, exports, module) {
    var Surface = require('famous/core/Surface');
	// CODE