GithubHelp home page GithubHelp logo

slindberg / 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 207 KB

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

License: MIT License

JavaScript 91.83% HTML 7.91% Handlebars 0.26%

ember-truth-helpers's Introduction

Ember Truth Helpers for HTMLBars Build Status

Helpers for HTMLBars {{#if}} & {{#unless}}.

eq, not, and, or and is-array.

eq

{{#if (eq 1 2)}} 1 == 2 {{/if}}
{{#unless (eq 1 2)}} 1 != 2 {{/unless}}

not

{{#if (not hasCrayons)}} I don't have crayons {{/if}}
{{#if (not hasCrayons hasPaper)}} I don't have crayons or paper {{/if}}

and

{{#if (and hasCrayons hasPaper)}} I have crayons and paper {{/if}}

or

{{#if (or hasCrayons hasPaper)}} I have something {{/if}}

is-array

{{#if (is-array siblings)}}
    {{#each siblings as |sibling|}}
        My sibling: {{sibling}}
    {{/each}}
{{/if}}

in combination

{{#if (and (not model.isLoading) model.isError)}}
    There was an error loading the model
{{/if}}

stand alone

{{and itsCold myJumper}}
<!--returns `myJumper` if `itsCold` is truthy, otherwise returns `itsCold`-->

Install

  • ember install:addon 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

  • 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

ef4 avatar ember-tomster avatar jayphelps avatar jmurphyau avatar

Watchers

 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.