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

"other" frameworks #6

Closed
threepointone opened this issue Jul 23, 2016 · 5 comments
Closed

"other" frameworks #6

threepointone opened this issue Jul 23, 2016 · 5 comments

Comments

@threepointone
Copy link
Owner

frameworks that use jsx/virtual dom should be able to use this out of the box. however, not sure how to apply these data attributes in angular/ember templates. keeping this issue open to investigate; please help/contribute!

@threepointone
Copy link
Owner Author

jade was simple; they have an &attributes(object) operator that spreads the object onto the element's attributes.
screen shot 2016-07-24 at 1 50 49 am

@shrayasr
Copy link

Angular JS comes with ng-attr-* and ng-class. So usage is something like

<div class="text-center" ng-class="{'text-danger': someBoolValue}">Foobar</div>

which would apply the text-danger class if someBoolValue is true

Reference: https://docs.angularjs.org/guide/interpolation


ps: Hope this is what you were looking for. I'm slightly new to frontend stuff, so might be wrong

@treshugart
Copy link

I think for libraries and frameworks that don't use a virtual dom, then there will always be an integration step to sync the changes.

For libraries that don't use JSX, but do use a virtual DOM you can possibly just use Object.assign().

For example, Skate uses Incremental DOM and JSX is optional. So you can either:

<div {...style({}) } someattr="test" />

Or:

skate.vdom.element('div', Object.assign({}, style({}), { someattr: 'test' }));

@threepointone
Copy link
Owner Author

couldn't figure out ember or angular templates. closing this issue, I think the main ones are covered.

@threepointone
Copy link
Owner Author

fyi - ember/angular templates can use classname support now, so this is simpler

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

No branches or pull requests

3 participants