From 2f5eaeb5e5f782d3b738afa9008cea5a48708daf Mon Sep 17 00:00:00 2001 From: Michael Brade Date: Sat, 21 Mar 2015 18:08:55 +0100 Subject: [PATCH] make components written in LiveScript work --- lib/components.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/components.js b/lib/components.js index 65230d082..9017ce86a 100644 --- a/lib/components.js +++ b/lib/components.js @@ -164,6 +164,12 @@ App.prototype.component = function(viewName, constructor) { if (typeof viewName === 'function') { constructor = viewName; viewName = null; + } else if (typeof viewName === 'object') { + var keys = Object.keys(viewName); + if (keys.length == 1) { + constructor = viewName[keys[0]]; + viewName = null; + } } // Inherit from Component