New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ember-submit-button

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-submit-button

Ember Addon containing the most delightful submit button there ever was!

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

ember-submit-button

npm version Build Status Coverage Status

submit-button is a small Ember component that has a handy list of features. Pass it the ember-data model being edited in a form and it will:

  • Dynamically determine button text. (eg: if the model is an existing Post, the button text will be: Update Post)
  • Automatically disable the button while the model isSaving
  • Automatically change button text to Saving... while model isSaving

Installation

ember install ember-submit-button

Usage

The simplest use case

<form {{action 'save' on='submit'}}>
  // ...
  {{submit-button model=group}}
  // ...
</form>

Custom Text

{{#submit-button model=post}}
  {{if post.isDraft 'Publish' 'Update'}} Post
{{/submit-button}}

Calling a custom action on click

{{submit-button model=post action="publish"}}

Custom 'isSaving' text

  {{submit-button model=post savingText="Submitting"}}

Not passing in a model and providing a Boolean value for if its disabled

  {{submit-button disabled=someVariable}}

Component API

model: Ember Data Model

The model to observe. If save() has been triggered on the model, component will automatically disable to the button so it cannot be clicked again.

disable: {Boolean}

Default: null

Passing in a disable value will cause the component to ignore the model attribute all together. The component will watch this attribute and update accordingly.

savingText: {String}

Default: Saving

action: {String}

A custom action to fire on click.

Contributing

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • 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 15 Jun 2016

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