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 Jun 14, 2015
1 parent 774d652 commit 2f5eaeb
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 2f5eaeb

Please sign in to comment.