Skip to content

Commit

Permalink
add support for 'name' option in components
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Mar 29, 2017
1 parent 575aec7 commit a53637a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/global/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ Moon.directive = function(name, action) {
*/
Moon.component = function(name, opts) {
let Parent = this;
opts.name = name;

if(opts.name) {
name = opts.name;
} else {
opts.name = name;
}

function MoonComponent() {
Moon.call(this, opts);
Expand Down

0 comments on commit a53637a

Please sign in to comment.