This component is built to function just like a FwPromiseButton, except instead of working with promises it works with tasks. For more information on ember tasks, click here.

<FwTaskButton @buttonIcon="fa-regular fa-floppy-disk" @buttonText="Save" @class="btn btn-primary btn-sm" @task= />
Show:
reset () private

Task that resets the button back to normal after the task has been run.

_taskHasRan

Boolean private

This is a private boolean that logs whether the task has been completed or not.


Default: false

buttonIcon

String

If you want a button-icon to be displayed, put any of the font-awesome icons as a string here. Must use full icon name, including the class


Default: ''

buttonState

Computed private

This returns the buttonStyle based on the state that the button is in. If success, it is a success class; if error, danger class; and otherwise it is the normal button class. Watches: submitting, _taskHasRan.

buttonText

String

If you are rendering the promise button as an inline component and not in block form, set this to whatever text you want the button to display. If you are rendering in block form, this does not apply.


Default: ''

disableClick

Boolean

If true, this will prevent the task from being performed when the button is clicked. Otherwise it will work as normal.


Default: false

stateTimeout

Number

The time that the state of the button should be shown before returning to default. Time must be specified in milliseconds.


Default: 3000

task

Task

Task function to call when the button is clicked. This is required for button to function properly.


Default: null