APIs

Show:

Service for managing the state of the application. By default, to display application states, the states in Form Semantic UI are used.

Usage example

  1. Add a service to the application controller.
// app/controllers/application.js
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';

export default Controller.extend({
  appState: service(),
});
  1. Use the application state in the template.
<div class="ui  form">
  
</div>
  1. Use the service in another controller (or component).
// app/controllers/my-controller.js
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';

export default Controller.extend({
  appState: service(),

  actions: {
    load() {
      this.get('appState').loading();
      this.load().finally(() => {
        this.get('appState').reset();
      });
    },
  },
});

Methods

error

()

Sets the application state as error.

loading

()

Sets the application state as loading.

reset

()

Sets the application state to the default value.

success

()

Sets the application state as success.

validationHide

()

Sets the application validation as validation-hide.

validationShow

()

Sets the application validation to the default value.

warning

()

Sets the application state as warning.

Properties

_state

String private

Default: ''

_validation

String private

Default: ''

state

String

The application state.

validation

String

The application validation.