Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class attribute via DOM binding to append itself to existing classes and not overwrite all #46

Closed
orenmizr opened this issue Aug 29, 2015 · 1 comment
Labels

Comments

@orenmizr
Copy link

bindings: {
    "model.name": {
      type: 'attribute',
      hook: 'tabIcon',
      name: 'class'
    }
  }

this will make DIV.tab.tab__1 --> DIV.icon and not DIV.tab.tab__1.icon

is it possible to achieve that?

@pgilad
Copy link
Member

pgilad commented Aug 30, 2015

If you want to toggle a dynamic class you should use:
https://github.com/AmpersandJS/ampersand-dom-bindings#class

If you want to toggle a static boolean class, you should use:
https://github.com/AmpersandJS/ampersand-dom-bindings#booleanclass

attribute is the wrong binding to use here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants