Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logical Operators doesn't work anymore in 0.9 #1568

Closed
drxcheng opened this issue May 19, 2015 · 1 comment
Closed

Logical Operators doesn't work anymore in 0.9 #1568

drxcheng opened this issue May 19, 2015 · 1 comment

Comments

@drxcheng
Copy link

! || &&

Or is there an alternative way?

@arthurevans
Copy link

0.9 doesn't support any expressions, except for simple negation (!).

https://www.polymer-project.org/0.9/docs/migration.html#data-binding

In most cases, what you want is a computed binding:

<span>{{userType(user.type, defaultType)}}</span>

Where userType is a function like:

userType: function(type, default) {
 return type || default;
}

Note that in 0.9, computed bindings don't accept literal arguments at this point (that is, I can't use {{userType(user.type, "End User")}}. However I believe that's already checked in to master and should be in 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants