Giter VIP home page Giter VIP logo

ember-truth-helpers's Introduction

Ember Truth Helpers Build Status

HTMLBars template helpers for additional truth logic in if and unless statements.

Installation

ember install ember-truth-helpers

Usage

Helper JavaScript HTMLBars Variable argument count allowed
eq if (a === b) {{if (eq a b)}} No
not-eq if (a !== b) {{if (not-eq a b)}} No
not if (!a) {{if (not a)}} Yes
and if (a && b) {{if (and a b)}} Yes
or if (a || b) {{if (or a b)}}     Yes
xor if (a && !b || !a && b) {{if (xor a b)}} No
gt if (a > b) {{if (gt a b)}} No
gte if (a >= b) {{if (gte a b)}} No
lt if (a < b) {{if (lt a b)}} No
lte if (a <= b) {{if (lte a b)}} No
is-array if (Ember.isArray(a)) {{if (is-array a)}} Yes
is-empty if (Ember.isEmpty(a)) {{if (is-empty a)}} No
is-equal if (Ember.isEqual(a, b)) {{if (is-equal a b)}} No

API

is-equal

is-equal uses Ember.isEqual helper to evaluate equality of two values. eq should be sufficient for most applications. is-equal is necessary when trying to compare a complex object to a primitive value.

Other Helpers

Contributing

Installation

  • git clone https://github.com/jmurphyau/ember-truth-helpers.git
  • cd ember-truth-helpers
  • yarn

Linting

  • yarn lint:hbs
  • yarn lint:js
  • yarn lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.

ember-truth-helpers's People

Contributors

adjohnson916 avatar dhaulagiri avatar ef4 avatar elwayman02 avatar ember-tomster avatar glavin001 avatar jayphelps avatar jevanlingen avatar jmurphyau avatar keeo avatar loganrosen avatar mixonic avatar rondale-sc avatar rwjblue avatar rwolffgang avatar snewcomer avatar taras avatar toranb avatar turbo87 avatar xiphiasuvella avatar xuefeng-zhu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.