Ember HTMLBars helpers for enhanced conditional logic in templates, including not, and, or, eq, and is-array.
Ember Truth Helpers is an Ember.js addon that provides a set of HTMLBars template helpers to extend the conditional logic capabilities of `if` and `unless` statements. It simplifies complex boolean expressions directly in templates, improving readability and reducing the need for JavaScript in component logic.
Ember.js developers building applications with HTMLBars templates who need more expressive conditional logic in their templates without resorting to JavaScript in components.
Developers choose this addon because it offers a declarative, concise way to handle complex boolean logic in templates, following Ember's conventions while providing JavaScript-like expressions, and it includes TypeScript definitions for Glint support and compatibility with modern Ember tooling like Single File Components.
Ember HTMLBars Helpers for {{if}} & {{unless}}: not, and, or, eq & is-array
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows complex boolean expressions like `{{if (and a b c)}}` directly in templates, improving readability and reducing JavaScript in components as per the README's philosophy.
Includes helpers for equality, logical operations (AND, OR, XOR, NOT), numeric comparisons, and array checks, covering a wide range of conditional needs without custom code.
Supports Ember v4.8+, Glint for TypeScript, and Single File Components (.gts/.gjs), aligning with current Ember best practices and tooling.
Helpers like `and`, `or`, and `not` accept variable numbers of arguments, providing flexibility similar to JavaScript operators for complex conditions.
Exclusively designed for Ember.js with HTMLBars, making it unusable in other JavaScript frameworks or vanilla projects, limiting portability.
Requires Ember v4.8+ and compatibility with Embroider or ember-auto-import v2, which can be a barrier for teams with older codebases needing upgrades.
The `eq` helper only handles shallow equality; for complex objects, `is-equal` is needed, which relies on Ember's `isEqual` and might not cover all edge cases efficiently.