intercellular / cell

A self-driving web app framework
https://www.celljs.org
MIT License
1.5k stars 94 forks source link

[Bug?] this.class cannot set class #35

Closed almonk closed 7 years ago

almonk commented 7 years ago

With the following code I cannot set the class of the button:

{
    $type: 'button',
    $text: 'Send message',
    $init: function() {
      this.class = "button-primary"
    }
}

However, other attributes do work like this, for e.g.:

{
    $type: 'button',
    $text: 'Send message',
    $init: function() {
      this.disabled = true
    }
}
devsnek commented 7 years ago

try className as per spec

almonk commented 7 years ago

@devsnek where is this spec?

devsnek commented 7 years ago

https://developer.mozilla.org/en-US/docs/Web/API/Element/className

almonk commented 7 years ago

@devsnek this fixed it ! thanks