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

Add htmlAttributes attribute to allow developer to pass any html attribute to rendered img #55

Closed
2 tasks done
frederickfogerty opened this issue Jul 30, 2018 · 4 comments

Comments

@frederickfogerty
Copy link
Contributor

Before you submit:

Is your feature request related to a problem? Please describe.
Right now as a developer I am limited to passing the attributes that are specified by this library. This causes PRs such as #54 to be necessary to add support for HTML attributes. Instead, it would be better if we could allow the developer to pass any HTML attribute.

Describe the solution you'd like

{{imgix-image
    path='/assets/something/user.png'
    htmlAttributes=(hash
      alt="Alt text"
    )
}}
@Duder-onomy
Copy link
Collaborator

Good News! The Ember slack delivered.
If we use this, https://github.com/rwjblue/ember-angle-bracket-invocation-polyfill, which is basically the future of ember templates polyfilled.
We can do things like:

Supports passing attributes to be added to the root element of the component without @ prefix
<FooBar data-test-foo-bar></FooBar>

In which case, we can leave all the htmlAttributes out of the components attributeBindings and put all that back on the invoker.

The angle bracket invocation is still a polyfill, but it is only a matter of time now: as this pr emberjs/rfcs#311 has been merged.

@frederickfogerty
Copy link
Contributor Author

Interesting @Duder-onomy. Thanks for following up! As an aside, do you ever see them moving to JSX (this looks awfully a lot like JSX already)?

@frederickfogerty
Copy link
Contributor Author

For the polyfill, is it something that a consumer of ember-cli-imgix has to include, or is it something we can include at a library level?

@sherwinski
Copy link
Contributor

Closing as this issue is quite old - but we're happy to reopen if there is still a need for this at some point in the future.

@sherwinski sherwinski closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants