Giter VIP home page Giter VIP logo

Comments (14)

jevanlingen avatar jevanlingen commented on July 18, 2024 2

@plimeyepea: You missed one parenthese at the end, that's why it broke your application!

One parenthese to close the not-eq helper, one parenthese to close the or-helper => So in full:

{{#if (or (not-eq currentRouteName "index") (not-eq currentRouteName "signup")) }}
    {{partial 'navigation'}}
{{/if}}

from ember-truth-helpers.

jmurphyau avatar jmurphyau commented on July 18, 2024 1

I just added a test that demonstrates that this works

from ember-truth-helpers.

Keeo avatar Keeo commented on July 18, 2024

Did you try {{#if (or (not-eq a b) (not-eq a b))}}hello{{/if}} or {{if (or (not-eq a b) (not-eq a b)) 'hello'}}

from ember-truth-helpers.

piseilim avatar piseilim commented on July 18, 2024

That is exactly what I did, but it doesn't seem to like it very much. If I just do a single comparison it works, but not with the double.

from ember-truth-helpers.

Keeo avatar Keeo commented on July 18, 2024

Can you try {{if (or (not-eq true true) (not-eq false true)) 'hello'}}? This has to work.

from ember-truth-helpers.

jmurphyau avatar jmurphyau commented on July 18, 2024

you could try (not (eq a b) (eq c d))?

from ember-truth-helpers.

rwjblue avatar rwjblue commented on July 18, 2024

@plimeyepea - Can you express the logic in JS so that we can properly understand what you are trying to do?

from ember-truth-helpers.

piseilim avatar piseilim commented on July 18, 2024

I was trying to check to see if my currentRouteName is a certain route. So there's two routes I needed to check:

{{#if (or (not-eq currentRouteName "index") (not-eq currentRouteName "signup")}}
    {{partial 'navigation'}}
{{/if}}

However, when I added in the second (not-eq ... "signup"), it breaks my application.

from ember-truth-helpers.

bekzod avatar bekzod commented on July 18, 2024

I think something like this will be useful

(or (eq color 'red') (eq actionType 'green') (eq actionType 'yellow')) 
=> 
(any color 'red' 'green' 'yellow')

from ember-truth-helpers.

bekzod avatar bekzod commented on July 18, 2024

and not-any

(and (not-eq color 'red') (not-eq actionType 'green') (not-eq actionType 'yellow')) 
=> 
(not-any color 'red' 'green' 'yellow')

from ember-truth-helpers.

rrussell avatar rrussell commented on July 18, 2024

This feature will be really useful, some like that:

{{#if (or (eq a b c) (not-eq c d) (gt f g))}}
  {{ model.var }}
{{/if}}

etc...

from ember-truth-helpers.

sales avatar sales commented on July 18, 2024

+1

from ember-truth-helpers.

tinyweasel avatar tinyweasel commented on July 18, 2024

{{#if (and (or trueProperty falseProperty) (not falseProperty)}} does not work correctly. Should come out true but it's false.

from ember-truth-helpers.

darrenw-npi avatar darrenw-npi commented on July 18, 2024

{{#if (and (or trueProperty falseProperty) (not falseProperty)}} does not work correctly. Should come out true but it's false.

That is also missing a closing parenthesis

from ember-truth-helpers.

Related Issues (20)

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.