# ember-component-inbound-actions

> Send actions to Ember.js components

Latest version **1.3.1** (published 2018-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-component-inbound-actions
pnpm add ember-component-inbound-actions
yarn add ember-component-inbound-actions
bun add ember-component-inbound-actions
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2018-11-19 |
| First published | 2014-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 6.* \|\| 8.* \|\| >= 10.* |
| Dependencies | 1 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 65 |
| Author | Gavin Joyce |
| Maintainers | gavinjoyce, paddyobrien, patocallaghan |
| Keywords | ember-addon |

## Links

- npm: https://www.npmjs.com/package/ember-component-inbound-actions
- Repository: https://github.com/GavinJoyce/ember-component-inbound-actions
- Homepage: https://github.com/GavinJoyce/ember-component-inbound-actions#readme
- Issues: https://github.com/GavinJoyce/ember-component-inbound-actions/issues
- npm.io page: https://npm.io/package/ember-component-inbound-actions

## Dependencies (1)

- [ember-cli-babel](https://npm.io/package/ember-cli-babel.md) ^6.16.0

## Recent versions

- 1.3.1 (latest) — 2018-11-19
- 1.3.0 — 2018-05-27
- 1.2.1 — 2017-02-24
- 1.2.0 — 2016-11-02
- 1.1.0 — 2016-07-07
- 1.0.1 — 2016-02-01
- 1.0.0 — 2016-01-29
- 0.0.4 — 2015-08-04
- 0.0.3 — 2015-05-18
- 0.0.2 — 2014-10-27
- 0.0.1 — 2014-10-13

## README

# ember-component-inbound-actions

[![npm version](https://badge.fury.io/js/ember-component-inbound-actions.svg)](https://badge.fury.io/js/ember-component-inbound-actions)
[![Build Status](https://travis-ci.org/GavinJoyce/ember-component-inbound-actions.svg?branch=master)](https://travis-ci.org/GavinJoyce/ember-component-inbound-actions)
![Ember Version](https://embadge.io/v1/badge.svg?start=1.13.0)

Send actions to Ember.js components. Inspired by [Sam Selikoff's blog post](http://www.samselikoff.com/blog/2014/05/16/getting-ember-components-to-respond-to-actions/)

Questions? Ping me [@gavinjoyce](https://twitter.com/gavinjoyce)

## Installation

This is an Ember CLI addon, so all you need to do is

`npm install --save-dev ember-component-inbound-actions`
or
`ember install ember-component-inbound-actions`

## Usage Instructions

Add the `InboundActions` mixin to your component:

```javascript
import Em from 'ember';
import InboundActions from 'ember-component-inbound-actions/inbound-actions';

export default Em.Component.extend(InboundActions, {
  name: 'Larry David',
  actions: {
    reset: function() {
      this.set('name', '');
    }
  }
});
```

When declaring your component in a template, include an `actionReceiver` attribute:

```handlebars
{{name-form actionReceiver=nameForm}}
```

This allows you to reference the `nameForm` in your controller and invoke actions on it:

```javascript
this.get('nameForm').send('reset');
```

Or use the send helper to invoke actions on your component reference from within the template:

```hbs
{{name-form actionReceiver=nameForm}}

<button {{action (send nameForm "reset")}}>Reset</button>
```

## Development Instructions

* `git clone` this repository
* `npm install`
* `bower install`

### Running

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

---
_Source: https://npm.io/package/ember-component-inbound-actions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
