ember-query-selector-helper

0.2.0 • Public • Published

{{query-selector}} helper

Returns the first element within the document that matches the specified selector. It's a great companion to Ember's {{in-element}} helper.

Installation

ember install ember-query-selector-helper

Usage

<div id="modal-portal"></div>
 
{{#in-element (query-selector "#modal-portal")}}
  <Modal />
{{/in-element}}
{{#let (query-selector "#modal-portal" optional=true) as |portal|}}
  {{#if portal}}
    {{#in-element portal}}
      <Modal />
    {{/in-element}}
  {{else}}
    <Modal />
  {{/if}}
{{/let}}

Compatibility

  • Ember.js v3.12 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i ember-query-selector-helper

Weekly Downloads

25

Version

0.2.0

License

MIT

Unpacked Size

5.65 kB

Total Files

9

Last publish

Collaborators

  • ivanvotti