Skip to content

Commit

Permalink
make components written in LiveScript work
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-brade committed May 12, 2015
1 parent 1323ef3 commit 4fa6e7c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4fa6e7c

Please sign in to comment.