New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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
Version published
Weekly downloads
160
16.79%
Maintainers
2
Weekly downloads
 
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

  • ember server
  • Visit your app at http://localhost:4200.

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

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

Keywords

ember-addon

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