2

I need to print a value of variable depending of value of other variable. I am using angular js.

My code to print in view is:

{{w.date == 0 ? w.eventIndex : w.date | date: 'medium'}}

I need apply date filter only for w.date, but not for w.eventIndex. I can take other way without problem, but I would like keep this way

1 Answer 1

2

Try the following:

{{w.date == 0 ? w.eventIndex : (w.date | date: 'medium')}}

That should apply the filter only to w.date.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.