Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.22 KB

no-action-modifiers.md

File metadata and controls

38 lines (24 loc) · 1.22 KB

no-action-modifiers

This rule forbids the use of {{action}} modifiers on elements.

The recommended alternative is the on modifier. on is available in Ember 3.11+ and by polyfill for earlier versions.

Examples

This rule forbids the following:

<button {{action 'submit'}}>Submit</button>

This rule allows the following:

<button {{on 'click' this.submit}}>Submit</button>

Configuration

The following values are valid configuration:

  • boolean -- true for enabled / false for disabled
  • array -- an allowlist of element tag names, which will accept action modifiers

References

  • Documentation for template actions
  • Polyfill for the on modifier (needed below Ember 3.11)
  • Spec for the on modifier
  • Spec for the action modifier

Related Rules