1
value="{{Temp.r1c2t != SS ? '100' : '250'}}"  

This code will worked fine. When am getting value from database it ll show error.

My code here

value="{{Temp.r1c2t != SS ? {{Temp.SSFareAmount}} : {{Temp.SFareAmount}}}}"
2
  • value="{{Temp.r1c2t != SS ? {{Temp.SSFareAmount}} : {{Temp.SFareAmount}}}}" should be value="{{Temp.r1c2t != SS ? Temp.SSFareAmount : Temp.SFareAmount}}" because you are already evaluating it as expression in {{}} . so u don`t need it again Commented Nov 29, 2016 at 5:50
  • value="{{Temp.r1c2t != SS ? Temp.SSFareAmount : Temp.SFareAmount}}" here Temp.r1c2t value is SS and SH but both condition i got Temp.SSFareAmount only. here i need like this SS - Temp.SSFareAmount and SH - Temp.SFareAmount Commented Nov 29, 2016 at 6:02

2 Answers 2

0

Have to use with out curly braces.

Like Below

value="{{Temp.r1c2t != SS ? Temp.SSFareAmount : Temp.SFareAmount}}"

answer mentioned in comments also.

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

2 Comments

value="{{SS != SS ? Temp.SSFareAmount : Temp.SFareAmount}}" It ll getTemp.SSFareAmount and SS != SH it ll getTemp.SFareAmount
Can you share controller code and Temp scope object?.
0

the {{}} are called interpolation bindings and they are only needed once per expression.

value="{{Temp.r1c2t != SS ? Temp.SSFareAmount : Temp.SFareAmount}}"

but it would probably be better to access this as an object like:

value={{temp.glue[temp.r1c2t]}}

where glue is in the controller:

vm.glue = {
    "SS": vm.SSFareAmount,
    "SF": vm.SSFareAmount
}

a quick demo and you can see that it works just fine.

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.