Socket
Book a DemoInstallSign in
Socket

ember-is-component

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-is-component

Provides a helper to check if a component exists.

1.0.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

ember-is-component

Provides a helper to check if a component exists.

Compatibility

  • Ember.js v3.28 or above
  • Embroider or ember-auto-import v2

Installation

ember install ember-is-component

Usage

This addon provides a helper that checks if a component exists. A component exists if a factory for it is found in the helper's owner.

is-component helper is useful if your context makes the existence of a component uncertain (for instance if the name is generated dynamically or if a dependency may or may not provide it...) and you want to check the component's existence before instantiating it safely.

{{#if (is-component "my-component")}}
  <MyComponent />
{{else}}
  <p>MyComponent was not found.</p>
{{/if}}

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Keywords

ember

FAQs

Package last updated on 24 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.