Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-is-component

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-is-component

`{{is-component componentName}}` helper for your Ember apps

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

ember-cli-is-component TravisCI Badge

This addon provides a new helper: is-component to be used as follows:

{{is-component componentName}}

The helper returns true when the first parameter can be looked up a component; false otherwise.

Example with the {{component}} helper

The {{component}} helper throws an error when an invalid component name is given as parameter. Used with {{if}}, the (is-component) helper offers a nice failsafe to avoid the rendering error when the component may not exist:

{{#if (is-component componentName)}}
  {{component componentName}}
{{else}}
  Sorry, {{componentName}} is not a known component.
{{/if}}

Example as a computed property

isComponent: inject(),
exists: computed(function() {
  return this.get('isComponent').test('my-component');
})

Installation

ember install ember-cli-is-component

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

Keywords

FAQs

Package last updated on 03 Jan 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc