Coder Social home page Coder Social logo

toranb / ember-truth-helpers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jmurphyau/ember-truth-helpers

0.0 2.0 0.0 169 KB

Ember HTMLBars Helpers for {{if}} & {{unless}}: not, and, or, eq & is-array

License: MIT License

JavaScript 96.13% HTML 3.87%

ember-truth-helpers's Introduction

Ember Truth Helpers Build Status

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

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-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.

Install

  • ember install ember-truth-helpers

Other Helpers

Development

  • git clone https://github.com/jmurphyau/ember-truth-helpers.git
  • npm install
  • bower install
  • ember server
  • Visit your app at http://localhost:4200.

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

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

ember-truth-helpers's People

Contributors

jmurphyau avatar rwjblue avatar taras avatar turbo87 avatar jevanlingen avatar adjohnson916 avatar ef4 avatar glavin001 avatar jayphelps avatar elwayman02 avatar xiphiasuvella avatar keeo avatar ember-tomster avatar rwolffgang avatar

Watchers

James Cloos avatar  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.